nixos-config/configs/nixos/ni/disko.nix

73 lines
1.9 KiB
Nix
Raw Normal View History

{ primaryDisk ? "/dev/nvme0n1", config, lib, ... }:
2023-06-30 05:38:22 +00:00
{
2024-11-21 03:51:25 +00:00
disko.devices = lib.mkMerge [
{
disk."${config.networking.hostName}-primary" = {
device = primaryDisk;
type = "disk";
content = {
type = "gpt";
partitions = {
# You can't really have a btrfs-layered boot so this'll have to do.
ESP = {
priority = 1;
start = "0";
end = "512MiB";
type = "EF00";
content = {
type = "filesystem";
mountpoint = "/boot";
format = "vfat";
};
};
2023-06-30 05:38:22 +00:00
2024-11-21 03:51:25 +00:00
swap = {
start = "-8GiB";
end = "-0";
type = "8200";
content = {
type = "swap";
randomEncryption = true;
};
2024-02-27 13:07:40 +00:00
};
2024-11-21 03:51:25 +00:00
root = {
size = "100%";
type = "8300";
content = {
type = "btrfs";
extraArgs = [ "-f" ];
2024-11-21 03:51:25 +00:00
subvolumes = lib.mkMerge [
{
"/root" = {
mountOptions = [ "compress=zstd" ];
mountpoint = "/";
};
"/home" = {
mountOptions = [ "compress=zstd" ];
mountpoint = "/home";
};
"/nix" = {
mountOptions = [ "compress=zstd" "noatime" "noacl" ];
mountpoint = "/nix";
};
}
2023-06-30 05:38:22 +00:00
2024-11-21 03:51:25 +00:00
(lib.mkIf config.services.guix.enable {
"/gnu" = {
mountOptions = [ "compress=zstd" "noatime" "noacl" ];
mountpoint = "/gnu";
};
})
];
};
};
2023-06-30 05:38:22 +00:00
};
};
};
2024-11-21 03:51:25 +00:00
}
];
2023-06-30 05:38:22 +00:00
}