From b9d2c624c0d622e41445caf83752841c880fd2ae Mon Sep 17 00:00:00 2001 From: Daniel Flanagan Date: Thu, 26 Dec 2024 14:30:29 -0600 Subject: [PATCH] Update disko configs --- disko/default.nix | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/disko/default.nix b/disko/default.nix index 2a8b32d..f12d487 100644 --- a/disko/default.nix +++ b/disko/default.nix @@ -1,5 +1,21 @@ {lib, ...}: let inherit (lib.attrsets) mapAttrs' filterAttrs; + ESP = size: { + priority = 1; + start = "1M"; + end = size; + label = "EFI"; + name = "ESP"; + type = "EF00"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; + mountOptions = [ + "umask=0077" + ]; + }; + }; in { standardWithHibernateSwap = { disks ? ["/dev/sda"], @@ -80,14 +96,14 @@ in { }; }; }; - standard = {disks ? ["/dev/vda"], ...}: { + standard = {disk, ...}: { # this is my standard partitioning scheme for my machines: an LUKS-encrypted # btrfs volume disko.devices = { disk = { primary = { type = "disk"; - device = builtins.elemAt disks 0; + device = disk; content = { type = "gpt"; partitions = { @@ -143,36 +159,24 @@ in { }; }; - unencrypted = {disks ? ["/dev/vda"], ...}: { + unencrypted = {disk, ...}: { disko.devices = { disk = { primary = { type = "disk"; - device = builtins.elemAt disks 0; + device = disk; content = { type = "gpt"; partitions = { - ESP = { - label = "EFI"; - name = "ESP"; - size = "512M"; - type = "EF00"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - mountOptions = [ - "defaults" - ]; - }; - }; + ESP = ESP "5G"; root = { size = "100%"; content = { type = "btrfs"; extraArgs = ["-f"]; + mountpoint = "/partition-root"; subvolumes = { - "/root" = { + "/rootfs" = { mountpoint = "/"; mountOptions = []; };