refactor: move persistence into modules where possible
This commit is contained in:
parent
9f1cf602e5
commit
1764a421ab
10 changed files with 45 additions and 14 deletions
|
@ -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"
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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; [
|
||||
|
|
|
@ -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 ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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 ];
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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" ];
|
||||
|
|
Loading…
Reference in a new issue