aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaroline Larimore <caroline@larimo.re>2025-02-07 21:11:17 -0800
committerCaroline Larimore <caroline@larimo.re>2025-04-14 18:58:48 -0700
commit55c77539b662cf2e1745b1c3d8e458f3cbf73731 (patch)
tree42c69aa42456df2aeea02efc819396ea767ca5ec
parentaa1ac68a50f6a1c1d4252d999ea908a3d2de72d5 (diff)
migration: home impermanence
-rw-r--r--hosts/c-pc/home.nix8
-rw-r--r--snowfall/modules/home/impermanence/default.nix50
2 files changed, 50 insertions, 8 deletions
diff --git a/hosts/c-pc/home.nix b/hosts/c-pc/home.nix
index 3a23cbb..3a221f6 100644
--- a/hosts/c-pc/home.nix
+++ b/hosts/c-pc/home.nix
@@ -15,14 +15,6 @@
allowOther = true;
directories = [
- "Downloads"
- "Documents"
- "Pictures"
- "Videos"
- "Music"
- "Games"
- "Persist"
-
"code"
".local/bin"
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;
+ };
+ };
+}