1# this was kind of the config used for it, ended up not using it because i had gotten confused about something, but the end result was the same so who cares
2# also if you're reading this never use nano to write a password file to use in one of these because luks counts the newline nano forces on you as a character
3{
4 config,
5 lib,
6 ...
7}: {
8 options.myDisko = {
9 installDrive = lib.mkOption {
10 description = "Disk to install NixOS to.";
11 default = "/dev/disk/by-id/ata-ADATA_IM2S3338-128GD2_5J3020000635";
12 type = lib.types.str;
13 };
14 dataDrive = lib.mkOption {
15 description = "Data disk.";
16 default = "/dev/disk/by-id/ata-WDC_WD10SPZX-24Z10_WD-WXJ1A891NRKE";
17 type = lib.types.str;
18 };
19 };
20
21 config = {
22 assertions = [
23 {
24 assertion = config.myDisko.installDrive != "";
25 message = "config.myDisko.installDrive cannot be empty.";
26 }
27 ];
28
29 disko.devices = {
30 disk = {
31 ssd = {
32 type = "disk";
33 device = config.myDisko.installDrive;
34
35 content = {
36 type = "gpt";
37
38 partitions = {
39 ESP = {
40 content = {
41 format = "vfat";
42
43 mountOptions = [
44 "defaults"
45 "umask=0077"
46 ];
47
48 mountpoint = "/boot";
49 type = "filesystem";
50 };
51
52 size = "1024M";
53 type = "EF00";
54 };
55
56 luks = {
57 size = "100%";
58 content = {
59 type = "luks";
60 name = "crypted";
61
62 content = {
63 type = "btrfs";
64 extraArgs = ["-f"];
65
66 subvolumes = {
67 "@home" = {
68 mountpoint = "/home";
69 mountOptions = ["compress=zstd" "noatime"];
70 };
71
72 ".snapshots" = {
73 mountOptions = ["compress=zstd" "noatime"];
74 mountpoint = "/home/.snapshots";
75 };
76
77 "@nix" = {
78 mountpoint = "/nix";
79 mountOptions = ["compress=zstd" "noatime"];
80 };
81
82 "@" = {
83 mountpoint = "/";
84 mountOptions = ["compress=zstd" "noatime"];
85 };
86 };
87 };
88 };
89 };
90 };
91 };
92 };
93 harddrive = {
94 type = "disk";
95 device = config.myDisko.dataDrive;
96
97 content = {
98 type = "gpt";
99 partitions = {
100 luks = {
101 size = "100%";
102 content = {
103 type = "luks";
104 name = "crypted_harddrive";
105
106 content = {
107 type = "btrfs";
108 extraArgs = ["-f"];
109
110 subvolumes = {
111 "@data" = {
112 mountpoint = "/data";
113 mountOptions = ["compress=zstd" "noatime"];
114 };
115 };
116 };
117 };
118 };
119 };
120 };
121 };
122 };
123 };
124 };
125}