-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdisko.nix
67 lines (65 loc) · 1.61 KB
/
disko.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{
disko.devices = {
disk = {
nvme0n1 = {
type = "disk";
device = "/dev/nvme0n1";
content = {
type = "gpt";
partitions = {
ESP = {
size = "2G";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
zfs = {
size = "100%";
content = {
type = "zfs";
pool = "zroot";
};
};
};
};
};
};
zpool = {
zroot = {
type = "zpool";
mode = ""; # You can change this to "mirror" if you have another disk
rootFsOptions = {
compression = "zstd";
"com.sun:auto-snapshot" = "false";
};
mountpoint = "/";
postCreateHook = "zfs snapshot zroot@blank";
datasets = {
root = {
type = "zfs_fs";
mountpoint = "/";
options = {
mountpoint = "/";
encryption = "aes-256-gcm";
keyformat = "passphrase";
keylocation = "file:///tmp/secret.key";
};
};
home = {
type = "zfs_fs";
mountpoint = "/home";
};
persist = {
type = "zfs_fs";
mountpoint = "/persist";
};
encrypted = {type = "zfs_fs";};
};
};
};
};
}
# sudo nix run github:nix-community/disko -- --mode disko ./disko.nix --arg disks '[ "/dev/nvme0n1" ]'