This repository has no description
3.9 kB
159 lines
1{ lib, ... }:
2{
3 disko.imageBuilder.extraRootModules = [
4 "zfs"
5 ];
6 disko.tests.extraConfig = {
7 services.mingetty.autologinUser = "root";
8 };
9 disko.devices = {
10 disk =
11 (lib.genAttrs
12 [
13 "/dev/nvme0n1"
14 "/dev/nvme1n1"
15 ]
16 (disk: {
17 type = "disk";
18 device = disk;
19 imageSize = "3G";
20 content = {
21 type = "gpt";
22 partitions = {
23 boot = {
24 size = "1M";
25 type = "EF02";
26 };
27 ESP = {
28 size = "1G";
29 content = {
30 type = "mdraid";
31 name = "boot";
32 };
33 };
34 zfs = {
35 size = "100%";
36 content = {
37 type = "zfs";
38 pool = "zroot";
39 };
40 };
41 };
42 };
43 })
44 )
45 // {
46 hdd1 = {
47 type = "disk";
48 device = "/dev/sda";
49 content = {
50 type = "zfs";
51 pool = "tank";
52 };
53 };
54 };
55 mdadm = {
56 boot = {
57 type = "mdadm";
58 level = 1;
59 metadata = "1.0";
60 content = {
61 type = "filesystem";
62 format = "vfat";
63 mountpoint = "/boot";
64 };
65 };
66 };
67 zpool = {
68 zroot = {
69 type = "zpool";
70 mode = "mirror";
71 mountpoint = "/";
72 rootFsOptions = {
73 acltype = "posixacl";
74 xattr = "sa";
75 };
76 datasets = {
77 reserved = {
78 type = "zfs_fs";
79 options.refreservation = "1G";
80 };
81 pairprogramming = {
82 type = "zfs_fs";
83 mountpoint = "/home/pairprogramming";
84 options = {
85 canmount = "noauto";
86 };
87
88 };
89 };
90 };
91 tank = {
92 type = "zpool";
93 datasets = {
94 reserved = {
95 type = "zfs_fs";
96 options.refreservation = "1G";
97 };
98 containers = {
99 type = "zfs_fs";
100 mountpoint = "/var/lib/containers";
101 options = {
102 canmount = "noauto";
103 };
104 };
105 home = {
106 type = "zfs_fs";
107 mountpoint = "/home";
108 options = {
109 canmount = "noauto";
110 };
111 };
112 srv = {
113 type = "zfs_fs";
114 mountpoint = "/srv";
115 options = {
116 canmount = "noauto";
117 };
118 };
119 libvirt = {
120 type = "zfs_fs";
121 mountpoint = "/var/lib/libvirt";
122 options = {
123 canmount = "noauto";
124 };
125 };
126 # Radicle seed storage on the tank pool, hard-capped at 80G (allow-all
127 # seeding has no built-in byte quota; the ZFS quota bounds it). Create
128 # on an existing host with:
129 # zfs create -o mountpoint=/var/lib/radicle -o quota=80G tank/radicle
130 radicle = {
131 type = "zfs_fs";
132 mountpoint = "/var/lib/radicle";
133 options = {
134 canmount = "noauto";
135 quota = "80G";
136 };
137 };
138 # encrypted = {
139 # type = "zfs_fs";
140 # options = {
141 # canmount = "noauto";
142 # mountpoint = "none";
143 # encryption = "aes-256-gcm";
144 # keyformat = "passphrase";
145 # keylocation = "prompt";
146 # };
147 # };
148 # "encrypted/download" = {
149 # type = "zfs_fs";
150 # mountpoint = "/var/download";
151 # options = {
152 # canmount = "noauto";
153 # };
154 # };
155 };
156 };
157 };
158 };
159}