diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2022-02-05 20:09:41 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2022-02-05 20:09:41 +0100 |
commit | 1cdba8ee13f4364fa2f66ec9d3dc5e9c8c171270 (patch) | |
tree | 8115ab77b2aaa6c703429f4c9a3a6d418b114ca4 /hosts | |
parent | 204aaadf6f6f8c5de0dbcbfefae6fcfadc7b21a1 (diff) | |
download | nixos-1cdba8ee13f4364fa2f66ec9d3dc5e9c8c171270.tar nixos-1cdba8ee13f4364fa2f66ec9d3dc5e9c8c171270.tar.gz nixos-1cdba8ee13f4364fa2f66ec9d3dc5e9c8c171270.tar.bz2 nixos-1cdba8ee13f4364fa2f66ec9d3dc5e9c8c171270.tar.xz nixos-1cdba8ee13f4364fa2f66ec9d3dc5e9c8c171270.zip |
vidhar: ...
Diffstat (limited to 'hosts')
-rw-r--r-- | hosts/vidhar/zfs.nix | 61 |
1 files changed, 36 insertions, 25 deletions
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 { | |||
77 | fsType = "zfs"; | 77 | fsType = "zfs"; |
78 | }; | 78 | }; |
79 | 79 | ||
80 | "/var/lib/prometheus2" = | 80 | # "/var/lib/prometheus2" = |
81 | { device = "ssd-raid1/local/var-lib-prometheus2"; | 81 | # { device = "ssd-raid1/local/var-lib-prometheus2"; |
82 | fsType = "zfs"; | 82 | # fsType = "zfs"; |
83 | options = [ "zfsutil" ]; | 83 | # options = [ "zfsutil" ]; |
84 | }; | 84 | # }; |
85 | 85 | ||
86 | "/var/lib/grafana" = | 86 | # "/var/lib/grafana" = |
87 | { device = "ssd-raid1/local/var-lib-grafana"; | 87 | # { device = "ssd-raid1/local/var-lib-grafana"; |
88 | fsType = "zfs"; | 88 | # fsType = "zfs"; |
89 | options = [ "zfsutil" ]; | 89 | # options = [ "zfsutil" ]; |
90 | }; | 90 | # }; |
91 | 91 | ||
92 | "/var/lib/loki" = | 92 | # "/var/lib/loki" = |
93 | { device = "ssd-raid1/local/var-lib-loki"; | 93 | # { device = "ssd-raid1/local/var-lib-loki"; |
94 | fsType = "zfs"; | 94 | # fsType = "zfs"; |
95 | options = [ "zfsutil" ]; | 95 | # options = [ "zfsutil" ]; |
96 | }; | 96 | # }; |
97 | 97 | ||
98 | "/srv/tftp" = | 98 | # "/srv/tftp" = |
99 | { device = "ssd-raid1/local/srv-tftp"; | 99 | # { device = "ssd-raid1/local/srv-tftp"; |
100 | fsType = "zfs"; | 100 | # fsType = "zfs"; |
101 | options = [ "zfsutil" ]; | 101 | # options = [ "zfsutil" ]; |
102 | }; | 102 | # }; |
103 | 103 | ||
104 | "/var/log" = | 104 | "/var/log" = |
105 | { device = "ssd-raid1/local/var-log"; | 105 | { device = "ssd-raid1/local/var-log"; |
106 | fsType = "zfs"; | 106 | fsType = "zfs"; |
107 | }; | 107 | }; |
108 | 108 | ||
109 | "/home" = | 109 | # "/home" = |
110 | { device = "hdd-raid6/safe/home"; | 110 | # { device = "hdd-raid6/safe/home"; |
111 | fsType = "zfs"; | 111 | # fsType = "zfs"; |
112 | options = [ "zfsutil" ]; | 112 | # options = [ "zfsutil" ]; |
113 | }; | 113 | # }; |
114 | 114 | ||
115 | # "/home/gkleen" = | 115 | # "/home/gkleen" = |
116 | # { device = "hdd-raid6/safe/home/gkleen"; | 116 | # { device = "hdd-raid6/safe/home/gkleen"; |
@@ -125,6 +125,17 @@ in { | |||
125 | # }; | 125 | # }; |
126 | }; | 126 | }; |
127 | 127 | ||
128 | users.users.gkleen.createHome = lib.mkForce false; | ||
129 | users.users.mherold.createHome = lib.mkForce false; | ||
130 | |||
131 | boot.postBootCommands = '' | ||
132 | echo "=== STARTING ZPOOL IMPORT ===" | ||
133 | ${pkgs.zfs}/bin/zpool import -a -N -d /dev | ||
134 | ${pkgs.zfs}/bin/zpool status | ||
135 | ${pkgs.zfs}/bin/zfs mount -a | ||
136 | echo "=== ZPOOL IMPORT COMPLETE ===" | ||
137 | ''; | ||
138 | |||
128 | systemd.services = | 139 | systemd.services = |
129 | let mkSnapService = snapName: { | 140 | let mkSnapService = snapName: { |
130 | name = "zfs-snapshot-${snapName}"; | 141 | name = "zfs-snapshot-${snapName}"; |