diff options
| author | Caroline Larimore <caroline@larimo.re> | 2025-02-07 21:11:17 -0800 |
|---|---|---|
| committer | Caroline Larimore <caroline@larimo.re> | 2025-04-14 18:58:48 -0700 |
| commit | 55c77539b662cf2e1745b1c3d8e458f3cbf73731 (patch) | |
| tree | 42c69aa42456df2aeea02efc819396ea767ca5ec /snowfall | |
| parent | aa1ac68a50f6a1c1d4252d999ea908a3d2de72d5 (diff) | |
migration: home impermanence
Diffstat (limited to 'snowfall')
| -rw-r--r-- | snowfall/modules/home/impermanence/default.nix | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/snowfall/modules/home/impermanence/default.nix b/snowfall/modules/home/impermanence/default.nix new file mode 100644 index 0000000..1b92bca --- /dev/null +++ b/snowfall/modules/home/impermanence/default.nix @@ -0,0 +1,50 @@ +{ options, config, lib, namespace, inputs, host, ... }: + +with lib; with lib.${namespace}; let + cfg = config.${namespace}.impermanence; + hosts = [ "c-pc" ]; +in { + imports = [ + inputs.impermanence.nixosModules.home-manager.impermanence + ]; + + options.${namespace}.impermanence = with types; { + skeleton = mkOption { + type = bool; + default = true; + }; + + location = mkOption { + type = str; + default = "/persist/home"; + }; + + secure = { + location = mkOption { + type = str; + default = "/persist/secure/home"; + }; + }; + }; + + config = { + home.persistence.${cfg.location} = { + enable = builtins.elem host hosts; + allowOther = true; + + directories = mkIf cfg.skeleton [ + "Downloads" + "Documents" + "Pictures" + "Videos" + "Music" + "Games" + "Persist" + ]; + }; + + home.persistence.${cfg.secure.location} = { + enable = builtins.elem host hosts; + }; + }; +} |