From 1cdba8ee13f4364fa2f66ec9d3dc5e9c8c171270 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 5 Feb 2022 20:09:41 +0100 Subject: vidhar: ... --- hosts/vidhar/zfs.nix | 61 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 25 deletions(-) (limited to 'hosts/vidhar/zfs.nix') diff --git a/hosts/vidhar/zfs.nix b/hosts/vidhar/zfs.nix index b72f9f17..89de9dd2 100644 --- a/hosts/vidhar/zfs.nix +++ b/hosts/vidhar/zfs.nix @@ -77,40 +77,40 @@ in { fsType = "zfs"; }; - "/var/lib/prometheus2" = - { device = "ssd-raid1/local/var-lib-prometheus2"; - fsType = "zfs"; - options = [ "zfsutil" ]; - }; + # "/var/lib/prometheus2" = + # { device = "ssd-raid1/local/var-lib-prometheus2"; + # fsType = "zfs"; + # options = [ "zfsutil" ]; + # }; - "/var/lib/grafana" = - { device = "ssd-raid1/local/var-lib-grafana"; - fsType = "zfs"; - options = [ "zfsutil" ]; - }; + # "/var/lib/grafana" = + # { device = "ssd-raid1/local/var-lib-grafana"; + # fsType = "zfs"; + # options = [ "zfsutil" ]; + # }; - "/var/lib/loki" = - { device = "ssd-raid1/local/var-lib-loki"; - fsType = "zfs"; - options = [ "zfsutil" ]; - }; + # "/var/lib/loki" = + # { device = "ssd-raid1/local/var-lib-loki"; + # fsType = "zfs"; + # options = [ "zfsutil" ]; + # }; - "/srv/tftp" = - { device = "ssd-raid1/local/srv-tftp"; - fsType = "zfs"; - options = [ "zfsutil" ]; - }; + # "/srv/tftp" = + # { device = "ssd-raid1/local/srv-tftp"; + # fsType = "zfs"; + # options = [ "zfsutil" ]; + # }; "/var/log" = { device = "ssd-raid1/local/var-log"; fsType = "zfs"; }; - "/home" = - { device = "hdd-raid6/safe/home"; - fsType = "zfs"; - options = [ "zfsutil" ]; - }; + # "/home" = + # { device = "hdd-raid6/safe/home"; + # fsType = "zfs"; + # options = [ "zfsutil" ]; + # }; # "/home/gkleen" = # { device = "hdd-raid6/safe/home/gkleen"; @@ -125,6 +125,17 @@ in { # }; }; + users.users.gkleen.createHome = lib.mkForce false; + users.users.mherold.createHome = lib.mkForce false; + + boot.postBootCommands = '' + echo "=== STARTING ZPOOL IMPORT ===" + ${pkgs.zfs}/bin/zpool import -a -N -d /dev + ${pkgs.zfs}/bin/zpool status + ${pkgs.zfs}/bin/zfs mount -a + echo "=== ZPOOL IMPORT COMPLETE ===" + ''; + systemd.services = let mkSnapService = snapName: { name = "zfs-snapshot-${snapName}"; -- cgit v1.2.3