diff --git a/nix/configuration/configuration.nix b/nix/configuration/configuration.nix index 44cf3c4..47ef6c0 100644 --- a/nix/configuration/configuration.nix +++ b/nix/configuration/configuration.nix @@ -172,7 +172,6 @@ "/var/lib/nixos" # Contains user information (uids/gids) "/var/lib/systemd" # Systemd state directory for random seed, persistent timers, core dumps, persist hardware state like backlight and rfkill "/var/log/journal" # Logs, alternatively set `services.journald.storage = "volatile";` to write to /run/log/journal - "/etc/zfs/zpool.cache" # Which zpools to import, the root zpool is already imported and does not need this cache file but this captures additional pools. TODO consider setting cachefile=none on main pool. ]; files = [ "/etc/machine-id" # Systemd unique machine id "otherwise, the system journal may fail to list earlier boots, etc" diff --git a/nix/configuration/roles/zfs/default.nix b/nix/configuration/roles/zfs/default.nix index 94c6fcc..756d503 100644 --- a/nix/configuration/roles/zfs/default.nix +++ b/nix/configuration/roles/zfs/default.nix @@ -44,4 +44,11 @@ in zfs_clone_recv zfs_clone_resume ]; + + environment.persistence."/persist" = lib.mkIf (!config.me.buildingIso) { + hideMounts = true; + directories = [ + "/etc/zfs/zpool.cache" # Which zpools to import, the root zpool is already imported and does not need this cache file but this captures additional pools. + ]; + }; }