Skip to content

Commit

Permalink
feat: add disko khanelinix
Browse files Browse the repository at this point in the history
  • Loading branch information
khaneliman committed Oct 28, 2023
1 parent 6f1260f commit fc6876a
Showing 1 changed file with 152 additions and 0 deletions.
152 changes: 152 additions & 0 deletions systems/x86_64-linux/khanelinix/disks.nix
Original file line number Diff line number Diff line change
@@ -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;
};
};
};
};
};
};
};
};
};
}

0 comments on commit fc6876a

Please sign in to comment.