nut-gc2: add disko

This commit is contained in:
2025-10-29 13:20:51 +08:00
parent 4149eed283
commit 09262e8bac
3 changed files with 152 additions and 80 deletions

View File

@@ -1,86 +1,50 @@
{
disko.devices = {
disk = {
disk1 = {
main = {
type = "disk";
device = "/dev/vda";
content = {
type = "gpt";
partitions = {
ESP = {
size = "512M";
type = "EF00";
boot = {
size = "1M";
type = "EF02";
priority = 1;
};
root = {
end = "-4G";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = [ "umask=0077" ];
format = "ext4";
mountpoint = "/";
mountOptions = [ "noatime" ];
};
};
crypt_p1 = {
swap = {
size = "100%";
content = {
type = "luks";
name = "crypt_p1";
passwordFile = "/tmp/disk.key";
settings = {
allowDiscards = true;
};
type = "swap";
discardPolicy = "both";
resumeDevice = false; # resume from hiberation from this device
};
};
};
};
};
disk2 = {
vdb = {
type = "disk";
device = "/dev/nvme2n1";
device = "/dev/vdb";
content = {
type = "gpt";
partitions = {
crypt_p2 = {
root = {
size = "100%";
content = {
type = "luks";
name = "crypt_p2";
settings = {
allowDiscards = true;
};
content = {
type = "btrfs";
extraArgs = [
"-d raid1"
"/dev/mapper/crypt_p1"
];
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 = "64G";
mountOptions = [ "noatime" ];
};
};
};
type = "filesystem";
format = "ext4";
mountpoint = "/srv";
mountOptions = [ "noatime" ];
};
};
};