From 9e2042ae3a4ac74789d6c4c1d7dc19de78056e44 Mon Sep 17 00:00:00 2001 From: Kristian Krsnik Date: Mon, 8 Apr 2024 21:51:09 +0200 Subject: [PATCH] updated --- template/libs/default.nix | 149 ++++++++++++++++++++------------------ template/system/disko.nix | 1 + 2 files changed, 78 insertions(+), 72 deletions(-) diff --git a/template/libs/default.nix b/template/libs/default.nix index 797c6d1..01e81be 100644 --- a/template/libs/default.nix +++ b/template/libs/default.nix @@ -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"; + }; + } + ); }; }; }; diff --git a/template/system/disko.nix b/template/system/disko.nix index f889756..240d36f 100644 --- a/template/system/disko.nix +++ b/template/system/disko.nix @@ -3,4 +3,5 @@ libs.diskSetup { device = "/dev/sda"; ssd = true; swapCapacity = "2G"; + efi = true; }