Skip to content

Instantly share code, notes, and snippets.

@t56k
Created June 5, 2025 05:38
Show Gist options
  • Save t56k/bc077447d04528254b58ba02905d63d4 to your computer and use it in GitHub Desktop.
Save t56k/bc077447d04528254b58ba02905d63d4 to your computer and use it in GitHub Desktop.
disko.nix
{
disko.devices = {
disk = {
main = {
type = "disk";
nvme0n1 = {
device = "/dev/nvme0n1";
content = {
type = "gpt";
partitions = {
ESP = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = ["umask=0077"];
};
};
luks = {
size = "100%";
content = {
type = "luks";
name = "crypted";
settings = {
allowDiscards = true;
keyFile = "./secret.key";
};
content = {
type = "btrfs";
extraArgs = ["-f"];
subvolumes = {
"/root" = {
mountpoint = "/";
mountOptions = [
"compress=zstd"
"noatime"
];
};
"/home" = {
mountpoint = "/home";
mountOptions = [
"compress=zstd"
"noatime"
];
};
"/nix" = {
mountpoint = "/nix";
mountOptions = [
"compress=zstd"
"noatime"
];
};
"/swap" = {
mountpoint = "/.swapvol";
swap.swapfile.size = "20M";
};
};
};
};
};
};
};
};
};
};
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment