From 47d8b9fa41cecc36470c996cbc55f28f20defd36 Mon Sep 17 00:00:00 2001 From: Dict Xiong Date: Fri, 14 Jun 2024 00:13:22 +0800 Subject: [PATCH] build(nasp): enable zfs if networking.hostId is set --- hosts/g10/configuration.nix | 2 -- hosts/g11/configuration.nix | 2 -- hosts/g12/configuration.nix | 2 -- hosts/g14/configuration.nix | 2 -- hosts/g2/configuration.nix | 2 -- hosts/g3/configuration.nix | 2 -- hosts/g5/configuration.nix | 2 -- hosts/g6/configuration.nix | 2 -- hosts/g7/configuration.nix | 2 -- hosts/modules/nasp.nix | 5 +++++ 10 files changed, 5 insertions(+), 18 deletions(-) diff --git a/hosts/g10/configuration.nix b/hosts/g10/configuration.nix index 64124f4..af9a9b1 100644 --- a/hosts/g10/configuration.nix +++ b/hosts/g10/configuration.nix @@ -16,8 +16,6 @@ eth2Name = "enp2s0np0"; }; }; - boot.supportedFilesystems = [ "zfs" ]; - boot.zfs.forceImportRoot = false; networking.hostId = "c953033f"; system.stateVersion = "24.05"; } diff --git a/hosts/g11/configuration.nix b/hosts/g11/configuration.nix index 5022045..4465534 100644 --- a/hosts/g11/configuration.nix +++ b/hosts/g11/configuration.nix @@ -16,8 +16,6 @@ eth2Name = "enp2s0np0"; }; }; - boot.supportedFilesystems = [ "zfs" ]; - boot.zfs.forceImportRoot = false; networking.hostId = "50480d34"; system.stateVersion = "24.05"; } diff --git a/hosts/g12/configuration.nix b/hosts/g12/configuration.nix index 530a91e..f54ec23 100644 --- a/hosts/g12/configuration.nix +++ b/hosts/g12/configuration.nix @@ -16,8 +16,6 @@ eth2Name = "enp2s0np0"; }; }; - boot.supportedFilesystems = [ "zfs" ]; - boot.zfs.forceImportRoot = false; networking.hostId = "39c15810"; system.stateVersion = "24.05"; } diff --git a/hosts/g14/configuration.nix b/hosts/g14/configuration.nix index 6b3ca4d..83600f9 100644 --- a/hosts/g14/configuration.nix +++ b/hosts/g14/configuration.nix @@ -16,8 +16,6 @@ eth2Name = "enp2s0np0"; }; }; - boot.supportedFilesystems = [ "zfs" ]; - boot.zfs.forceImportRoot = false; networking.hostId = "32137a88"; system.stateVersion = "24.05"; } diff --git a/hosts/g2/configuration.nix b/hosts/g2/configuration.nix index 1bb2cd9..cf72c75 100644 --- a/hosts/g2/configuration.nix +++ b/hosts/g2/configuration.nix @@ -16,8 +16,6 @@ eth2Name = "enp2s0np0"; }; }; - boot.supportedFilesystems = [ "zfs" ]; - boot.zfs.forceImportRoot = false; networking.hostId = "b500d22c"; system.stateVersion = "23.11"; } diff --git a/hosts/g3/configuration.nix b/hosts/g3/configuration.nix index e9e6036..3094eaa 100644 --- a/hosts/g3/configuration.nix +++ b/hosts/g3/configuration.nix @@ -16,8 +16,6 @@ eth2Name = "enp2s0np0"; }; }; - boot.supportedFilesystems = [ "zfs" ]; - boot.zfs.forceImportRoot = false; networking.hostId = "6693ee3d"; system.stateVersion = "24.05"; } diff --git a/hosts/g5/configuration.nix b/hosts/g5/configuration.nix index 742a853..438cb35 100644 --- a/hosts/g5/configuration.nix +++ b/hosts/g5/configuration.nix @@ -16,8 +16,6 @@ eth2Name = "enp2s0np0"; }; }; - boot.supportedFilesystems = [ "zfs" ]; - boot.zfs.forceImportRoot = false; networking.hostId = "b24b8b5f"; system.stateVersion = "24.05"; } diff --git a/hosts/g6/configuration.nix b/hosts/g6/configuration.nix index 4286f66..c926a85 100644 --- a/hosts/g6/configuration.nix +++ b/hosts/g6/configuration.nix @@ -16,8 +16,6 @@ eth2Name = "enp2s0np0"; }; }; - boot.supportedFilesystems = [ "zfs" ]; - boot.zfs.forceImportRoot = false; networking.hostId = "94f672bf"; system.stateVersion = "24.05"; } diff --git a/hosts/g7/configuration.nix b/hosts/g7/configuration.nix index 1269356..b39f52a 100644 --- a/hosts/g7/configuration.nix +++ b/hosts/g7/configuration.nix @@ -16,8 +16,6 @@ eth2Name = "enp2s0np0"; }; }; - boot.supportedFilesystems = [ "zfs" ]; - boot.zfs.forceImportRoot = false; networking.hostId = "b2fd3ffb"; system.stateVersion = "24.05"; } diff --git a/hosts/modules/nasp.nix b/hosts/modules/nasp.nix index fc76d95..cdf5a62 100644 --- a/hosts/modules/nasp.nix +++ b/hosts/modules/nasp.nix @@ -133,6 +133,11 @@ in xkb.layout = "us"; }; } + (lib.mkIf (networking.hostId != null) { + boot.supportedFilesystems = [ "zfs" ]; + boot.zfs.forceImportRoot = false; + services.zfs.autoScrub.enable = true; + }) # nvidia (lib.mkIf (nvidiaCfg.enable) { nixpkgs.config.nvidia.acceptLicense = true;