aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIsabella Bastaja <isabella@sorre.xyz>2026-10-26 22:05:45 +0100
committerIsabella Bastaja <isabella@sorre.xyz>2026-10-27 01:27:22 +0100
commit05ad01612f9c75cc3e38940e52524736af1ead9d (patch)
tree9aa4821a06fe276d2a0fad46f5e450c8ad4b6775
parent1c06f302d9fcdf8ff28b07778540bce7a7cc4c49 (diff)
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
-rw-r--r--hosts/enode/disko.nix9
-rw-r--r--hosts/enode/impermenance.nix11
2 files changed, 9 insertions, 11 deletions
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 = {