This commit is contained in:
Kristian Krsnik 2024-04-08 21:51:09 +02:00
parent 008e6e98b7
commit 9e2042ae3a
Signed by: Kristian
GPG Key ID: FD1330AC9F909E85
2 changed files with 78 additions and 72 deletions

View File

@ -13,83 +13,88 @@
type = "disk"; type = "disk";
content = { content = {
type = "gpt"; type = "gpt";
partitions = { partitions =
"esp" = { {
size = "luks" = {
if efi size = "100%";
then "512M"
else "1M";
type =
if efi
then "EF00"
else "EF02";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = ["umask=0077"];
};
};
"luks" = {
size = "100%";
content = {
type = "luks";
name = "crypted";
settings.allowDiscards = true;
content = { content = {
type = "btrfs"; type = "luks";
extraArgs = ["-f"]; name = "crypted";
subvolumes = { settings.allowDiscards = true;
"/root" = {
mountpoint = "/"; content = {
mountOptions = type = "btrfs";
[ extraArgs = ["-f"];
"compress=zstd" subvolumes = {
"noatime" "/root" = {
] mountpoint = "/";
++ ( mountOptions =
if ssd [
then ["ssd"] "compress=zstd"
else [] "noatime"
); ]
}; ++ (
"/persist" = { if ssd
mountpoint = "/persist"; then ["ssd"]
mountOptions = else []
[ );
"compress=zstd" };
"noatime" "/persist" = {
] mountpoint = "/persist";
++ ( mountOptions =
if ssd [
then ["ssd"] "compress=zstd"
else [] "noatime"
); ]
}; ++ (
"/nix" = { if ssd
mountpoint = "/nix"; then ["ssd"]
mountOptions = else []
[ );
"compress=zstd" };
"noatime" "/nix" = {
] mountpoint = "/nix";
++ ( mountOptions =
if ssd [
then ["ssd"] "compress=zstd"
else [] "noatime"
); ]
}; ++ (
"/swap" = { if ssd
mountpoint = "/.swapvol"; then ["ssd"]
swap.swapfile.size = swapCapacity; else []
);
};
"/swap" = {
mountpoint = "/.swapvol";
swap.swapfile.size = swapCapacity;
};
}; };
}; };
}; };
}; };
}; }
}; // (
if efi
then {
"esp" = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
mountOptions = ["umask=0077"];
};
};
}
else {
"boot" = {
size = "512M";
type = "EF02";
};
}
);
}; };
}; };
}; };

View File

@ -3,4 +3,5 @@ libs.diskSetup {
device = "/dev/sda"; device = "/dev/sda";
ssd = true; ssd = true;
swapCapacity = "2G"; swapCapacity = "2G";
efi = true;
} }