Attempt to support both UEFI and BIOS

This commit is contained in:
Sravan Balaji
2024-03-24 15:42:47 -04:00
parent 6c06028e80
commit 8722b995cc
2 changed files with 15 additions and 14 deletions

View File

@@ -1,7 +1,7 @@
let
installDisk = "sda";
bootPartitionSize = "512M";
swapfileSize = "34G";
swapfileSize = "10G";
in {
disko.devices = {
disk = {
@@ -11,6 +11,10 @@ in {
content = {
type = "gpt";
partitions = {
boot = {
size = "1M";
type = "EF02"; # for grub MBR
};
ESP = {
size = bootPartitionSize;
type = "EF00";
@@ -27,31 +31,30 @@ in {
size = "100%";
content = {
type = "luks";
name = "crypted";
name = "cryptroot";
settings.allowDiscards = true;
# passwordFile = "/tmp/secret.key"; # Interactive
content = {
type = "btrfs";
extraArgs = [ "-f" ];
subvolumes = {
"/root" = {
"@" = {
mountpoint = "/";
mountOptions = [ "compress=zstd" "noatime" "discard=async" "space_cache=v2" "ssd" ];
};
"/home" = {
"@home" = {
mountpoint = "/home";
mountOptions = [ "compress=zstd" "noatime" "discard=async" "space_cache=v2" "ssd" ];
};
"/.snapshots" = {
"@.snapshots" = {
mountpoint = "/.snapshots";
mountOptions = [ "compress=zstd" "noatime" "discard=async" "space_cache=v2" "ssd" ];
};
"/nix" = {
"@nix" = {
mountpoint = "/nix";
mountOptions = [ "compress=zstd" "noatime" "discard=async" "space_cache=v2" "ssd" ];
};
"/swap" = {
mountpoint = "/.swapvol";
"@swap" = {
mountpoint = "/swap";
swap.swapfile.size = swapfileSize;
};
};