Personal-use NixOS configuration
1{
2 boot.initrd.systemd.enable = true;
3
4 disko.devices = {
5 disk = {
6 main = {
7 type = "disk";
8 device = "/dev/disk/by-id/nvme-WD_BLACK_SN7100_1TB_251356803910";
9
10 content = {
11 type = "gpt";
12
13 partitions = {
14 ESP = {
15 size = "512M";
16 type = "EF00";
17
18 content = {
19 type = "filesystem";
20
21 format = "vfat";
22 mountpoint = "/boot";
23 };
24 };
25
26 luks = {
27 size = "100%";
28
29 content = {
30 name = "cryptroot";
31 type = "luks";
32
33 extraOpenArgs = [
34 "--allow-discards"
35 "--perf-no_read_workqueue"
36 "--perf-no_write_workqueue"
37 ];
38
39 settings = {
40 crypttabExtraOpts = [
41 "tpm2-device=auto"
42 "token-timeout=10"
43 ];
44 };
45
46 content = {
47 type = "lvm_pv";
48 vg = "vg0";
49 };
50 };
51 };
52 };
53 };
54 };
55 };
56
57 lvm_vg.vg0 = {
58 type = "lvm_vg";
59
60 lvs = {
61 root = {
62 name = "root";
63 size = "100%FREE";
64
65 content = {
66 type = "filesystem";
67
68 format = "xfs";
69 mountpoint = "/";
70 };
71 };
72
73 swap = {
74 name = "swap";
75 size = "32G";
76
77 content = {
78 type = "swap";
79 };
80 };
81 };
82 };
83 };
84}