diff --git a/modules/hosts/arcturus/config.nix b/modules/hosts/arcturus/config.nix index 52ccd95..40ddbc9 100644 --- a/modules/hosts/arcturus/config.nix +++ b/modules/hosts/arcturus/config.nix @@ -17,8 +17,29 @@ ]; tnix = { - boot.secure-boot.enable = true; - boot.impermanence.enable = true; + boot = { + secure-boot.enable = true; + + impermanence = { + enable = true; + + home = { + directories = [ + ".config/sops" + ".local/share/nvim" + ".local/share/opencode" + ".local/share/zsh" + ".local/share/zoxide" + ".local/state/lazygit" + ]; + + files = [ + ".wakatime.cfg" + ]; + }; + }; + }; + networking.openssh.enable = true; services = { diff --git a/modules/nixos/boot/impermanence.nix b/modules/nixos/boot/impermanence.nix index 0dc6aac..b36eabc 100644 --- a/modules/nixos/boot/impermanence.nix +++ b/modules/nixos/boot/impermanence.nix @@ -4,6 +4,7 @@ { config, lib, + userName, ... }: let @@ -16,6 +17,28 @@ options.tnix.boot.impermanence = { enable = lib.mkEnableOption "Enable impermanence"; + + directories = lib.mkOption { + type = lib.types.listOf lib.types.str; + default = [ ]; + }; + + files = lib.mkOption { + type = lib.types.listOf lib.types.str; + default = [ ]; + }; + }; + + options.tnix.boot.impermanence.home = { + directories = lib.mkOption { + type = lib.types.listOf lib.types.str; + default = [ ]; + }; + + files = lib.mkOption { + type = lib.types.listOf lib.types.str; + default = [ ]; + }; }; config = lib.mkIf cfg.impermanence.enable { @@ -27,13 +50,34 @@ "/var/log" "/var/lib" "/etc/NetworkManager/system-connections" - ]; + ] + ++ cfg.impermanence.directories; + files = [ "/etc/ssh/ssh_host_ed25519_key" "/etc/ssh/ssh_host_ed25519_key.pub" "/etc/ssh/ssh_host_rsa_key" "/etc/ssh/ssh_host_rsa_key.pub" - ]; + ] + ++ cfg.impermanence.files; + }; + + home-manager.users.${userName} = { + home.persistence."/persist" = { + directories = [ + "Downloads" + "Music" + "Wallpapers" + "Documents" + "Videos" + "Projects" + "Stuff" + ".ssh" + ] + ++ cfg.impermanence.home.directories; + + files = cfg.impermanence.home.files; + }; }; boot.initrd.systemd = {