From 1d77028ac5096054662122e6c124232cf050ee91 Mon Sep 17 00:00:00 2001 From: Gerg-L Date: Mon, 21 Aug 2023 22:50:22 -0400 Subject: [PATCH] why disko why --- hosts/moms-laptop/disko.nix | 50 +++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/hosts/moms-laptop/disko.nix b/hosts/moms-laptop/disko.nix index 0d3a4cf..2038d7d 100644 --- a/hosts/moms-laptop/disko.nix +++ b/hosts/moms-laptop/disko.nix @@ -1,30 +1,32 @@ {disko, ...}: { imports = [disko.nixosModules.disko]; - disko.devices = { - disk.sda = { - device = "/dev/disk/by-id/ata-WDC_WDS240G2G0A-00JH30_180936803144"; - type = "disk"; - content = { - type = "gpt"; - partitions = { - ESP = { - start = "1MiB"; - end = "1GiB"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - }; + disko.devices.disk.sda = let + baseDevice = "/dev/disk/by-id/ata-WDC_WDS240G2G0A-00JH30_180936803144"; + in { + device = baseDevice; + type = "disk"; + content = { + type = "gpt"; + partitions = { + ESP = { + device = "${baseDevice}-part1"; + start = "1MiB"; + end = "1GiB"; + content = { + type = "filesystem"; + format = "vfat"; + mountpoint = "/boot"; }; - root = { - start = "1GiB"; - end = "100%"; - type = "EF00"; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; - }; + }; + root = { + device = "${baseDevice}-part2"; + start = "1GiB"; + end = "100%"; + type = "EF00"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; }; }; };