diff --git a/systems/x86_64-linux/khanelinix/disks.nix b/systems/x86_64-linux/khanelinix/disks.nix new file mode 100644 index 000000000..5853078eb --- /dev/null +++ b/systems/x86_64-linux/khanelinix/disks.nix @@ -0,0 +1,152 @@ +{ config, disks ? [ "/dev/nvme0n1" "/dev/nvme1n1" "/dev/sda" ], ... }: +let + defaultBtrfsOpts = [ "defaults" "compress=zstd:1" "ssd" "noatime" "nodiratime" ]; +in +{ + disko.devices = { + disk = { + nvme0 = { + device = builtins.elemAt disks 0; + type = "disk"; + content = { + type = "table"; + format = "gpt"; + partitions = { + EFI = { + priority = 1; + name = "EFI"; + start = "0%"; + end = "1024MiB"; + bootable = true; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + }; + }; + root = { + name = "NixOS"; + end = "-16G"; + content = { + type = "btrfs"; + name = "NixOS"; + extraOpenArgs = [ "--allow-discards" ]; + + content = { + type = "btrfs"; + # Override existing partition + extraArgs = [ "-f" ]; + + subvolumes = { + "@" = { + mountpoint = "/"; + mountOptions = defaultBtrfsOpts; + }; + "@home" = { + mountpoint = "/home"; + mountOptions = defaultBtrfsOpts; + }; + "@nix" = { + mountpoint = "/nix"; + mountOptions = defaultBtrfsOpts; + }; + }; + }; + }; + }; + swap = { + size = "100%"; + content = { + type = "swap"; + randomEncryption = true; + resumeDevice = true; # resume from hiberation from this device + }; + }; + }; + }; + }; + + nvme1 = { + device = builtins.elemAt disks 1; + type = "disk"; + content = { + type = "table"; + format = "gpt"; + partitions = { + root = { + size = "100%"; + type = "btrfs"; + name = "Linux"; + + content = { + type = "btrfs"; + # Override existing partition + extraArgs = [ "-f" ]; + subvolumes = { }; + }; + + }; + }; + }; + }; + + sda = { + device = builtins.elemAt disks 2; + type = "disk"; + content = { + type = "table"; + format = "gpt"; + partitions = { + root = { + size = "100%"; + type = "btrfs"; + name = "BtrProductive"; + + content = { + type = "btrfs"; + # Override existing partition + extraArgs = [ "-f" ]; + + subvolumes = { + "@games" = { + mountpoint = "/mnt/games"; + mountOptions = defaultBtrfsOpts; + }; + "@kvm" = { + mountpoint = "/mnt/kvm"; + mountOptions = defaultBtrfsOpts; + }; + "@steam" = { + mountpoint = "/mnt/steam"; + mountOptions = defaultBtrfsOpts; + }; + "@userdata/@documents" = { + mountpoint = "/home/${config.snowfallorg.user.name}/Documents"; + mountOptions = defaultBtrfsOpts; + }; + "@userdata/@downloads" = { + mountpoint = "/home/${config.snowfallorg.user.name}/Downloads"; + mountOptions = defaultBtrfsOpts; + }; + "@userdata/@music" = { + mountpoint = "/home/${config.snowfallorg.user.name}/Music"; + mountOptions = defaultBtrfsOpts; + }; + "@userdata/@pictures" = { + mountpoint = "/home/${config.snowfallorg.user.name}/Pictures"; + mountOptions = defaultBtrfsOpts; + }; + "@userdata/@videos" = { + mountpoint = "/home/${config.snowfallorg.user.name}/Videos"; + mountOptions = defaultBtrfsOpts; + }; + }; + }; + }; + }; + }; + }; + }; + }; +}