summaryrefslogtreecommitdiff
path: root/hosts
diff options
context:
space:
mode:
Diffstat (limited to 'hosts')
-rw-r--r--hosts/vidhar/default.nix31
-rw-r--r--hosts/vidhar/zfs.nix63
2 files changed, 67 insertions, 27 deletions
diff --git a/hosts/vidhar/default.nix b/hosts/vidhar/default.nix
index 6b266e2b..59518f07 100644
--- a/hosts/vidhar/default.nix
+++ b/hosts/vidhar/default.nix
@@ -35,6 +35,33 @@ with lib;
35 tmp.useTmpfs = true; 35 tmp.useTmpfs = true;
36 36
37 initrd = { 37 initrd = {
38 systemd = {
39 enable = true;
40 network = {
41 enable = true;
42 networks = {
43 "eno1" = {
44 matchConfig.Name = "eno1";
45 networkConfig = {
46 LLMNR = false;
47 MulticastDNS = false;
48 DNSSEC = false;
49 LinkLocalAddressing = "no";
50 Address = [
51 "10.141.1.1/24"
52 ];
53 DHCPServer = true;
54 };
55 dhcpServerConfig = {
56 EmitDNS = false;
57 EmitRouter = false;
58 EmitTimezone = false;
59 };
60 };
61 };
62 };
63 };
64
38 supportedFilesystems = [ "zfs" ]; 65 supportedFilesystems = [ "zfs" ];
39 availableKernelModules = [ "ehci_pci" "ahci" "nvme" "isci" "xhci_pci" "usb_storage" "usbhid" "sd_mod" "sr_mod" "drbg" "rtsx_pci_sdmmc" "libsas" "scsi_transport_sas" "e1000e" ]; 66 availableKernelModules = [ "ehci_pci" "ahci" "nvme" "isci" "xhci_pci" "usb_storage" "usbhid" "sd_mod" "sr_mod" "drbg" "rtsx_pci_sdmmc" "libsas" "scsi_transport_sas" "e1000e" ];
40 kernelModules = [ "dm-raid" "dm-integrity" "dm-snapshot" "dm-thin-pool" ]; 67 kernelModules = [ "dm-raid" "dm-integrity" "dm-snapshot" "dm-thin-pool" ];
@@ -50,8 +77,6 @@ with lib;
50 hdd4.device = "/dev/disk/by-label/${hostName}-hdd4"; 77 hdd4.device = "/dev/disk/by-label/${hostName}-hdd4";
51 hdd5.device = "/dev/disk/by-label/${hostName}-hdd5"; 78 hdd5.device = "/dev/disk/by-label/${hostName}-hdd5";
52 }; 79 };
53
54 network.flushBeforeStage2 = false;
55 }; 80 };
56 }; 81 };
57 82
@@ -308,7 +333,7 @@ with lib;
308 BATTERYLEVEL 10 333 BATTERYLEVEL 10
309 MINUTES 5 334 MINUTES 5
310 POLLTIME 1 335 POLLTIME 1
311 ONBATTERYDELAY 0 336 ONBATTERYDELAY 20
312 NOLOGON disable 337 NOLOGON disable
313 ''; 338 '';
314 }; 339 };
diff --git a/hosts/vidhar/zfs.nix b/hosts/vidhar/zfs.nix
index b490a6c2..518c3287 100644
--- a/hosts/vidhar/zfs.nix
+++ b/hosts/vidhar/zfs.nix
@@ -1,4 +1,7 @@
1{ pkgs, lib, config, ... }: 1{ pkgs, lib, config, ... }:
2
3with lib;
4
2{ 5{
3 config = { 6 config = {
4 fileSystems = { 7 fileSystems = {
@@ -12,9 +15,10 @@
12 fsType = "zfs"; 15 fsType = "zfs";
13 }; 16 };
14 17
15 "/root" = 18 "/var/lib/sops-nix" =
16 { device = "ssd-raid1/safe/home-root"; 19 { device = "ssd-raid1/local/var-lib-sops--nix";
17 fsType = "zfs"; 20 fsType = "zfs";
21 neededForBoot = true;
18 }; 22 };
19 23
20 "/var/lib/systemd" = 24 "/var/lib/systemd" =
@@ -29,31 +33,36 @@
29 neededForBoot = true; 33 neededForBoot = true;
30 }; 34 };
31 35
32 "/var/lib/sops-nix" = 36 "/etc/zfs/zfs-list.cache" =
33 { device = "ssd-raid1/local/var-lib-sops--nix"; 37 { device = "ssd-raid1/local/zfs-zfs--list.cache";
34 fsType = "zfs"; 38 fsType = "zfs";
35 neededForBoot = true; 39 neededForBoot = true;
36 }; 40 };
37 41
38 "/var/lib/unbound" = 42 "/root" =
39 { device = "ssd-raid1/local/var-lib-unbound"; 43 { device = "ssd-raid1/safe/home-root";
40 fsType = "zfs"; 44 fsType = "zfs";
41 }; 45 };
42 46
47 # "/var/lib/unbound" =
48 # { device = "ssd-raid1/local/var-lib-unbound";
49 # fsType = "zfs";
50 # };
51
43 # "/var/lib/dhcp" = 52 # "/var/lib/dhcp" =
44 # { device = "ssd-raid1/local/var-lib-dhcp"; 53 # { device = "ssd-raid1/local/var-lib-dhcp";
45 # fsType = "zfs"; 54 # fsType = "zfs";
46 # }; 55 # };
47 56
48 "/var/lib/chrony" = 57 # "/var/lib/chrony" =
49 { device = "ssd-raid1/local/var-lib-chrony"; 58 # { device = "ssd-raid1/local/var-lib-chrony";
50 fsType = "zfs"; 59 # fsType = "zfs";
51 }; 60 # };
52 61
53 "/var/lib/samba" = 62 # "/var/lib/samba" =
54 { device = "ssd-raid1/local/var-lib-samba"; 63 # { device = "ssd-raid1/local/var-lib-samba";
55 fsType = "zfs"; 64 # fsType = "zfs";
56 }; 65 # };
57 66
58 # "/var/lib/prometheus2" = 67 # "/var/lib/prometheus2" =
59 # { device = "ssd-raid1/local/var-lib-prometheus2"; 68 # { device = "ssd-raid1/local/var-lib-prometheus2";
@@ -124,13 +133,21 @@
124 users.users.gkleen.createHome = lib.mkForce false; 133 users.users.gkleen.createHome = lib.mkForce false;
125 users.users.mherold.createHome = lib.mkForce false; 134 users.users.mherold.createHome = lib.mkForce false;
126 135
127 boot.postBootCommands = '' 136 systemd.generators."zfs-mount-generator" = "${config.boot.zfs.package}/lib/systemd/system-generator/zfs-mount-generator";
128 echo "=== STARTING ZPOOL IMPORT ===" 137 environment.etc."zfs/zed.d/history_event-zfs-list-cacher.sh".source = "${config.boot.zfs.package}/etc/zfs/zed.d/history_event-zfs-list-cacher.sh";
129 ${pkgs.zfs}/bin/zpool import -a -N -d /dev 138 systemd.services.zfs-mount.enable = false;
130 ${pkgs.zfs}/bin/zpool status 139
131 ${pkgs.zfs}/bin/zfs mount -a 140 services.zfs.zed.settings.PATH = mkForce (makeBinPath (with pkgs; [
132 echo "=== ZPOOL IMPORT COMPLETE ===" 141 diffutils
133 ''; 142 config.boot.zfs.package
143 coreutils
144 curl
145 gawk
146 gnugrep
147 gnused
148 nettools
149 util-linux
150 ]));
134 151
135 services.zfssnap = { 152 services.zfssnap = {
136 enable = true; 153 enable = true;
@@ -152,8 +169,6 @@
152 enable = true; 169 enable = true;
153 interval = "Sun *-*-1..7 04:00:00"; 170 interval = "Sun *-*-1..7 04:00:00";
154 }; 171 };
155 services.zfs.zed.settings = { 172 services.zfs.zed.settings.ZED_SYSLOG_SUBCLASS_EXCLUDE = "history_event";
156 ZED_SYSLOG_SUBCLASS_EXCLUDE = "history_event";
157 };
158 }; 173 };
159} 174}