diff --git a/disks/root.nix b/disks/root.nix new file mode 100644 index 0000000..75c70f3 --- /dev/null +++ b/disks/root.nix @@ -0,0 +1,44 @@ +{ disks, ... }: { + disk = { + boot = { + type = "disk"; + device = builtins.elemAt disks 0; + content = { + type = "table"; + format = "gpt"; + partitions = [ + # Boot partition + { + type = "partition"; + name = "ESP"; + start = "0"; + end = "512MiB"; + fs-type = "fat32"; + bootable = true; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + extraArgs = [ "-n boot" ]; + }; + } + # Root partition ext4 + { + type = "partition"; + name = "root"; + start = "512MiB"; + end = "100%"; + part-type = "primary"; + bootable = true; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; + extraArgs = [ "-L nixos" ]; + }; + } + ]; + }; + }; + }; +} diff --git a/flake.nix b/flake.nix index c6e45a0..7f851c3 100644 --- a/flake.nix +++ b/flake.nix @@ -153,6 +153,7 @@ }; diskoConfigurations = { + root = import ./disks/root.nix; swan = { ... }: (import ./hosts/swan/disks.nix { }).disko.devices; };