1{
2 config,
3 lib,
4 ...
5}: {
6 options.myDisko.installDrive = lib.mkOption {
7 description = "Disk to install NixOS to.";
8 default = "/dev/sda";
9 type = lib.types.str;
10 };
11
12 config = {
13 assertions = [
14 {
15 assertion = config.myDisko.installDrive != "";
16 message = "config.myDisko.installDrive cannot be empty.";
17 }
18 ];
19
20 disko.devices = {
21 disk.disk1 = {
22 device = config.myDisko.installDrive;
23 type = "disk";
24 content = {
25 type = "gpt";
26 partitions = {
27 boot = {
28 name = "boot";
29 size = "1M";
30 type = "EF02";
31 };
32 esp = {
33 name = "ESP";
34 size = "500M";
35 type = "EF00";
36 content = {
37 type = "filesystem";
38 format = "vfat";
39 mountpoint = "/boot";
40 };
41 };
42 root = {
43 name = "root";
44 size = "100%";
45 content = {
46 type = "lvm_pv";
47 vg = "pool";
48 };
49 };
50 };
51 };
52 };
53
54 lvm_vg = {
55 pool = {
56 type = "lvm_vg";
57 lvs = {
58 root = {
59 size = "100%FREE";
60 content = {
61 type = "filesystem";
62 format = "ext4";
63 mountpoint = "/";
64 mountOptions = [
65 "defaults"
66 ];
67 };
68 };
69 };
70 };
71 };
72 };
73 };
74}