-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdisk-configuration.nix
84 lines (73 loc) · 2.43 KB
/
disk-configuration.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
{
disko.devices = {
disk."main" = {
type = "disk";
device = "/dev/disk/by-diskseq/1";
content = {
type = "gpt";
partitions = {
ESP = {
size = "500M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "rootfs";
settings = {
allowDiscards = true;
};
content = {
type = "btrfs";
extraArgs = ["-f"]; # Override existing partition
mountpoint = "/btrfs";
mountOptions = ["compress=zstd:1" "noatime"];
subvolumes = {
# current root, is swapped out each boot
"root/current" = {
mountOptions = ["noatime"];
mountpoint = "/";
};
"nix" = {
mountOptions = ["compress=zstd:1" "noatime"];
mountpoint = "/nix";
};
"persist" = {
mountOptions = ["compress=zstd:1" "noatime"];
mountpoint = "/persist";
};
# steam needs ~/.steam and ~/.local/share/Steam to be regular folders or mounts
# these folders cannot be symlinks or bind mounts, else steam will crash
"steam" = {
mountOptions = ["compress=zstd:1" "noatime"];
mountpoint = "/home/different/.steam";
};
"lssteam" = {
mountOptions = ["compress=zstd:1" "noatime"];
mountpoint = "/home/different/.local/share/Steam";
};
};
};
};
};
};
};
};
};
fileSystems = {
"/persist".neededForBoot = true; # Required for impermanence to work
};
systemd.tmpfiles.rules = [
# correcting permissions for subvolumes mounted within home directory
"d /home/different/.steam 0755 different users -"
"d /home/different/.local 0755 different users -"
"d /home/different/.local/share 0755 different users -"
"d /home/different/.local/share/Steam 0755 different users -"
];
}