From d4b81d128f5e9525bd29b4771ac566e00cc831d4 Mon Sep 17 00:00:00 2001 From: Caroline Larimore Date: Sat, 8 Feb 2025 14:09:56 -0800 Subject: migration: configure home impermanence from system --- snowfall/modules/home/impermanence/default.nix | 29 ++++++++++++-------------- 1 file changed, 13 insertions(+), 16 deletions(-) (limited to 'snowfall/modules/home/impermanence') diff --git a/snowfall/modules/home/impermanence/default.nix b/snowfall/modules/home/impermanence/default.nix index c1d1a2d..f132a6a 100644 --- a/snowfall/modules/home/impermanence/default.nix +++ b/snowfall/modules/home/impermanence/default.nix @@ -1,8 +1,9 @@ -{ options, config, lib, namespace, inputs, host, ... }: +{ options, config, osConfig, lib, namespace, inputs, host, ... }: with lib; with lib.${namespace}; let - cfg = config.${namespace}.impermanence; - hosts = [ "c-pc" ]; + cfg = config.${namespace}.impermanence // { + inherit (osConfig.${namespace}.system.impermanence.home) enable location secure; + }; in { imports = [ inputs.impermanence.nixosModules.home-manager.impermanence @@ -14,22 +15,18 @@ in { default = true; }; - location = mkOption { - type = str; - default = "/persist/home"; - }; - - secure = { - location = mkOption { - type = str; - default = "/persist/secure/home"; - }; - }; + enable = mkOption { type = uniq bool; }; + location = mkOption { type = uniq str; }; + secure.location = mkOption { type = uniq str; }; }; config = { + ${namespace}.impermanence = { + inherit (cfg) enable location secure; + }; + home.persistence.${cfg.location} = { - enable = builtins.elem host hosts; + enable = cfg.enable; allowOther = true; directories = mkIf cfg.skeleton [ @@ -44,7 +41,7 @@ in { }; home.persistence.${cfg.secure.location} = { - enable = builtins.elem host hosts; + enable = cfg.enable; allowOther = false; }; }; -- cgit v1.2.3