From 05ad01612f9c75cc3e38940e52524736af1ead9d Mon Sep 17 00:00:00 2001 From: Isabella Bastaja Date: Mon, 26 Oct 2026 22:05:45 +0100 Subject: enode: fix impermenance and disko config - don't persist the whole of /var/lib - fix persistence path/mount - persist a few other misc. paths like host ssh keys --- hosts/enode/disko.nix | 9 --------- hosts/enode/impermenance.nix | 11 +++++++++-- 2 files changed, 9 insertions(+), 11 deletions(-) (limited to 'hosts/enode') diff --git a/hosts/enode/disko.nix b/hosts/enode/disko.nix index 259e805..b09de01 100644 --- a/hosts/enode/disko.nix +++ b/hosts/enode/disko.nix @@ -35,14 +35,6 @@ let "noatime" ]; }; - "/lib" = { - mountpoint = "/var/lib"; - mountOptions = [ - "subvol=lib" - "compress=zstd" - "noatime" - ]; - }; "/persist" = { mountpoint = "/var/lib/persist"; mountOptions = [ @@ -111,5 +103,4 @@ in fileSystems."/var/lib/persist".neededForBoot = true; fileSystems."/var/log".neededForBoot = true; - fileSystems."/var/lib".neededForBoot = true; } diff --git a/hosts/enode/impermenance.nix b/hosts/enode/impermenance.nix index 3401e8e..20df233 100644 --- a/hosts/enode/impermenance.nix +++ b/hosts/enode/impermenance.nix @@ -1,4 +1,8 @@ -{ utils, ... }: { +{ config, utils, ... }: +let + ssh-host-keys = map (k: k.path) (builtins.attrValues config.services.openssh.hostKeys); +in +{ # Use /var/lib/persist as the persistence root, matching Disko's mountpoint environment.persistence."/var/lib/persist" = { hideMounts = true; @@ -6,6 +10,7 @@ "/var/lib/nixos" "/var/lib/systemd/coredump" "/var/lib/systemd/timers" + "/var/lib/systemd/linger" "/var/lib/backups" "/var/lib/headscale" @@ -18,10 +23,12 @@ } ]; files = [ + "/var/lib/systemd/random-seed" "/etc/machine-id" "/etc/shadow" "/etc/passwd" - ]; + ] + ++ ssh-host-keys; }; boot.initrd.systemd.services.wipe-root = { -- cgit v1.3.1