chore: tried further improving impermanence

This commit is contained in:
Patrick Großmann 2023-06-03 00:08:21 +09:00
parent fc740d4d32
commit a33980d00a
Signed by: patrick
GPG key ID: 451F95EFB8BECD0F
4 changed files with 36 additions and 31 deletions

View file

@ -1,7 +1,6 @@
{
config,
lib,
pkgs,
...
}: {
# to allow all users to access hm managed persistent folders
@ -25,6 +24,9 @@
]
++ lib.lists.optionals config.hardware.acpilight.enable [
"/var/lib/systemd/backlight"
]
++ lib.lists.optionals config.hardware.bluetooth.enable [
"/var/lib/bluetooth"
];
};
}

View file

@ -1,4 +1,4 @@
{
{pkgs, ...}: {
imports = [
./shells/alias.nix
./shells/zsh
@ -7,6 +7,10 @@
./impermanence.nix
];
home.packages = with pkgs; [
bat
];
nixpkgs.config = {
allowUnfree = true;
};

View file

@ -4,7 +4,7 @@
nixosConfig,
...
}: {
home.persistence."/state/home/${config.home.username}" = with lib.lists; {
home.persistence."/state/${config.home.homeDirectory}" = with lib.lists; {
allowOther = true;
files = [
".ssh/known_hosts"
@ -20,32 +20,35 @@
})
x;
in
optionals config.programs.atuin.enable [
".local/share/atuin"
]
++ optionals config.programs.direnv.enable [
".local/share/direnv"
]
++ optionals config.programs.neovim.enable [
".local/share/nvim"
".local/state/nvim"
".cache/nvim"
]
++ optionals config.programs.firefox.enable [
# firefox cannot be a symlink as home manager refuses put files outside your $HOME
optionals config.programs.firefox.enable [
".mozilla"
# root should never use interactive programs
]
++ optionals (config.home.username != "root") (
optionals nixosConfig.services.pipewire.enable [
# persist sound config
".local/state/wireplumber"
++ makeSymLinks (
optionals config.programs.atuin.enable [
".local/share/atuin"
]
++ optionals nixosConfig.programs.steam.enable
(makeSymLinks [
".local/share/Steam"
".steam"
".local/share//Daedalic Entertainment GmbH/The Pillars of the Earth/"
])
++ optionals config.programs.direnv.enable [
".local/share/direnv"
]
++ optionals config.programs.neovim.enable [
".local/share/nvim"
".local/state/nvim"
".cache/nvim"
]
# root should never use interactive programs
++ optionals nixosConfig.users.users.${config.home.username}.isNormalUser (
optionals nixosConfig.services.pipewire.enable [
# persist sound config
".local/state/wireplumber"
]
++ optionals nixosConfig.programs.steam.enable
[
".local/share/Steam"
".steam"
".local/share//Daedalic Entertainment GmbH/"
]
)
);
};
}

View file

@ -1,12 +1,8 @@
{pkgs, ...}: {
{
imports = [
./programs/direnv.nix
./programs/htop.nix
./programs/nvim
./programs/git.nix
];
home.packages = with pkgs; [
bat
];
}