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";
content = {
type = "gpt";
partitions = {
"esp" = {
size =
if efi
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;
partitions =
{
"luks" = {
size = "100%";
content = {
type = "btrfs";
extraArgs = ["-f"];
subvolumes = {
"/root" = {
mountpoint = "/";
mountOptions =
[
"compress=zstd"
"noatime"
]
++ (
if ssd
then ["ssd"]
else []
);
};
"/persist" = {
mountpoint = "/persist";
mountOptions =
[
"compress=zstd"
"noatime"
]
++ (
if ssd
then ["ssd"]
else []
);
};
"/nix" = {
mountpoint = "/nix";
mountOptions =
[
"compress=zstd"
"noatime"
]
++ (
if ssd
then ["ssd"]
else []
);
};
"/swap" = {
mountpoint = "/.swapvol";
swap.swapfile.size = swapCapacity;
type = "luks";
name = "crypted";
settings.allowDiscards = true;
content = {
type = "btrfs";
extraArgs = ["-f"];
subvolumes = {
"/root" = {
mountpoint = "/";
mountOptions =
[
"compress=zstd"
"noatime"
]
++ (
if ssd
then ["ssd"]
else []
);
};
"/persist" = {
mountpoint = "/persist";
mountOptions =
[
"compress=zstd"
"noatime"
]
++ (
if ssd
then ["ssd"]
else []
);
};
"/nix" = {
mountpoint = "/nix";
mountOptions =
[
"compress=zstd"
"noatime"
]
++ (
if ssd
then ["ssd"]
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";
ssd = true;
swapCapacity = "2G";
efi = true;
}