diff --git a/modules/profiles/impermanence.nix b/modules/profiles/impermanence.nix index a3b9fa2..bca52f3 100644 --- a/modules/profiles/impermanence.nix +++ b/modules/profiles/impermanence.nix @@ -18,6 +18,7 @@ in }; users.mutableUsers = false; environment.persistence."/persist" = { + enable = cfg.enable; hideMounts = true; directories = [ "/etc/NetworkManager/system-connections" @@ -27,7 +28,6 @@ in "/var/lib/nixos" "/var/lib/systemd" "/var/log" - "/etc/mullvad-vpn/" ]; files = [ "/etc/machine-id" @@ -39,27 +39,14 @@ in ]; users.moritz = { directories = [ - ".SynologyDrive/data" - ".SynologyDrive/log" ".cache/keepassxc" - ".cache/nvim/luac" ".cat_installer" # eduroam - ".config/JetBrains" - ".config/Mullvad VPN/" ".config/Nextcloud" ".config/Signal/" ".config/calibre" - ".config/github-copilot" - ".config/kdeconnect" ".config/keepassxc" - ".java/.userPrefs/jetbrains/" - ".local/share/JetBrains" - ".local/share/PrismLauncher/" ".local/share/Steam/" - ".local/share/direnv" - ".local/share/nvim" ".local/share/zoxide" - ".local/state/nvim" ".mozilla" "Documents" "Downloads" diff --git a/modules/profiles/personal_calendar.nix b/modules/profiles/personal_calendar.nix index 49512fe..bb17b0f 100644 --- a/modules/profiles/personal_calendar.nix +++ b/modules/profiles/personal_calendar.nix @@ -12,6 +12,9 @@ in options.my.profiles.personal.calendar = mkEnableOption "calendar"; config = mkIf cfg.contacts { + environment.persistence."/persist".users.moritz.directories = [ + ".local/share/vdirsyncer/" + ]; home-manager.users.moritz = { programs.khal.enable = true; programs.vdirsyncer.enable = true; diff --git a/modules/profiles/personal_contacts.nix b/modules/profiles/personal_contacts.nix index 0e8b1b4..7476b1b 100644 --- a/modules/profiles/personal_contacts.nix +++ b/modules/profiles/personal_contacts.nix @@ -12,6 +12,9 @@ in options.my.profiles.personal.contacts = mkEnableOption "contacts"; config = mkIf cfg.contacts { + environment.persistence."/persist".users.moritz.directories = mkIf (!cfg.calendar) [ + ".local/share/vdirsyncer/" + ]; home-manager.users.moritz = { programs.khard.enable = true; programs.vdirsyncer.enable = true; diff --git a/modules/programs/direnv.nix b/modules/programs/direnv.nix index 119ac6d..0452939 100644 --- a/modules/programs/direnv.nix +++ b/modules/programs/direnv.nix @@ -11,6 +11,10 @@ in options.my.programs.direnv.enable = mkEnableOption "direnv"; config = mkIf cfg.enable { + environment.persistence."/persist".users.moritz.directories = [ + ".local/share/direnv" + ]; + home-manager.users.moritz.programs.direnv = { enable = true; nix-direnv.enable = true; diff --git a/modules/programs/jetbrains/default.nix b/modules/programs/jetbrains/default.nix index 78034e7..2a283ee 100644 --- a/modules/programs/jetbrains/default.nix +++ b/modules/programs/jetbrains/default.nix @@ -24,6 +24,12 @@ in }; config = mkIf anyEnabled { + environment.persistence."/persist".users.moritz.directories = [ + ".config/JetBrains" + ".java/.userPrefs/jetbrains/" + ".local/share/JetBrains" + ]; + home-manager.users.moritz = { xdg.configFile."ideavim/ideavimrc" = { source = ./ideavimrc; diff --git a/modules/programs/nvim/default.nix b/modules/programs/nvim/default.nix index 403aca8..b0f5c80 100644 --- a/modules/programs/nvim/default.nix +++ b/modules/programs/nvim/default.nix @@ -11,6 +11,13 @@ in options.my.programs.nvim.enable = mkEnableOption "nvim"; config = mkIf cfg.enable { + environment.persistence."/persist".users.moritz.directories = [ + ".cache/nvim/luac" + ".config/github-copilot" + ".local/share/nvim" + ".local/state/nvim" + ]; + home-manager.users.moritz = { home.packages = with pkgs; [ diff --git a/modules/programs/prismlauncher.nix b/modules/programs/prismlauncher.nix index 54c01aa..fe8dda2 100644 --- a/modules/programs/prismlauncher.nix +++ b/modules/programs/prismlauncher.nix @@ -21,6 +21,10 @@ in options.my.programs.prismlauncher.enable = mkEnableOption "prismlauncher"; config = mkIf cfg.enable { + environment.persistence."/persist".users.moritz.directories = [ + ".local/share/PrismLauncher/" + ]; + users.users.moritz.packages = [ prismlauncher ]; }; } diff --git a/modules/services/kdeconnect.nix b/modules/services/kdeconnect.nix index 3efd6a8..5725e02 100644 --- a/modules/services/kdeconnect.nix +++ b/modules/services/kdeconnect.nix @@ -15,6 +15,10 @@ in options.my.services.kdeconnect.enable = mkEnableOption "kdeconnect"; config = mkIf cfg.enable { + environment.persistence."/persist".users.moritz.directories = [ + ".config/kdeconnect" + ]; + home-manager.users.moritz.services.kdeconnect.enable = mkIf (!config.my.programs.gnome.enable) true; networking.firewall = { allowedTCPPortRanges = [ ports ]; diff --git a/modules/services/mullvad.nix b/modules/services/mullvad.nix index 3840016..581f06e 100644 --- a/modules/services/mullvad.nix +++ b/modules/services/mullvad.nix @@ -12,6 +12,14 @@ in options.my.services.mullvad.enable = mkEnableOption "mullvad"; config = lib.mkIf cfg.enable { + environment.persistence."/persist" = { + directories = [ + "/etc/mullvad-vpn/" + ]; + users.moritz.directories = [ + ".config/Mullvad VPN/" + ]; + }; services.mullvad-vpn.enable = true; users.users.moritz.packages = with pkgs; [ mullvad-vpn diff --git a/modules/services/synology-drive.nix b/modules/services/synology-drive.nix index 63776d1..ac057cf 100644 --- a/modules/services/synology-drive.nix +++ b/modules/services/synology-drive.nix @@ -15,6 +15,11 @@ in }; config = mkIf cfg.enable { + environment.persistence."/persist".users.moritz.directories = [ + ".SynologyDrive/data" + ".SynologyDrive/log" + ]; + systemd.user.services.synology-drive = { after = [ "graphical-session.target" "network.target" ]; partOf = [ "graphical-session.target" ];