From 19cf31b0941c94201a431caf913e05946c3555e3 Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Sat, 18 Jan 2025 11:13:53 -0500 Subject: [PATCH] Move a zfs setting into the zfs role. --- nix/configuration/configuration.nix | 1 - nix/configuration/roles/zfs/default.nix | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) 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. + ]; + }; }