diff options
| author | Caroline Larimore <caroline@larimo.re> | 2025-02-04 22:15:16 -0800 |
|---|---|---|
| committer | Caroline Larimore <caroline@larimo.re> | 2025-04-14 18:58:44 -0700 |
| commit | 7d0b7575657aabdf58307e7e6c0cc037d2c14147 (patch) | |
| tree | 806834c52a2d19ac78da53700b8aa0ea8038ee0e /snowfall/modules/nixos/system | |
| parent | c87b0fdb42e76424f3f5ccae6f46e26ecf20b8f3 (diff) | |
migration: root impermanence
Diffstat (limited to 'snowfall/modules/nixos/system')
| -rw-r--r-- | snowfall/modules/nixos/system/default.nix | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/snowfall/modules/nixos/system/default.nix b/snowfall/modules/nixos/system/default.nix index 9fa3902..dc790bd 100644 --- a/snowfall/modules/nixos/system/default.nix +++ b/snowfall/modules/nixos/system/default.nix @@ -12,10 +12,30 @@ in { default = null; type = nullOr str; }; + + impermanent = mkEnableOption "root impermanence"; }; config = { networking.hostName = cfg.hostname; networking.hostId = cfg.id; + + environment = mkIf cfg.impermanent { + persistence."/persist/system" = { + hideMounts = true; + + directories = [ + "/etc/nixos" + "/var/log" + "/var/lib/nixos" + "/var/lib/systemd/coredump" + # "/var/lib/bluetooth" + ]; + + files = [ + "/etc/machine-id" + ]; + }; + }; }; } |