From 9ce12a87d3d449f9e189aa488d5957cc2717125b Mon Sep 17 00:00:00 2001 From: Gerg-L Date: Mon, 21 Aug 2023 23:05:13 -0400 Subject: [PATCH] alright disko --- hosts/game-laptop/disko.nix | 50 +++++++++++++++++++----------------- hosts/gerg-desktop/disko.nix | 18 ++++++++++--- 2 files changed, 40 insertions(+), 28 deletions(-) diff --git a/hosts/game-laptop/disko.nix b/hosts/game-laptop/disko.nix index 75b2085..c73fe60 100644 --- a/hosts/game-laptop/disko.nix +++ b/hosts/game-laptop/disko.nix @@ -1,30 +1,32 @@ {disko, ...}: { imports = [disko.nixosModules.disko]; - disko.devices = { - disk.nvme0n1 = { - device = "/dev/disk/by-id/nvme-WDC_PC_SN530_SDBPNPZ-512G-1006_21311N802456"; - type = "disk"; - content = { - type = "gpt"; - partitions = { - ESP = { - name = "ESP"; - start = "1MiB"; - end = "1GiB"; - content = { - type = "filesystem"; - format = "vfat"; - mountpoint = "/boot"; - }; + disko.devices.disk.nvme0n1 = let + baseDevice = "/dev/disk/by-id/nvme-WDC_PC_SN530_SDBPNPZ-512G-1006_21311N802456"; + 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%"; - content = { - type = "filesystem"; - format = "ext4"; - mountpoint = "/"; - }; + }; + root = { + device = "${baseDevice}-part2"; + start = "1GiB"; + end = "100%"; + type = "EF00"; + content = { + type = "filesystem"; + format = "ext4"; + mountpoint = "/"; }; }; }; diff --git a/hosts/gerg-desktop/disko.nix b/hosts/gerg-desktop/disko.nix index edb19b5..ff323ec 100644 --- a/hosts/gerg-desktop/disko.nix +++ b/hosts/gerg-desktop/disko.nix @@ -2,13 +2,16 @@ imports = [disko.nixosModules.disko]; disko.devices = { disk = { - "0E" = { + "0E" = let + baseDevice = "/dev/disk/by-id/nvme-SHPP41-500GM_SSB4N6719101A4N0E"; + in { type = "disk"; - device = "/dev/disk/by-id/nvme-SHPP41-500GM_SSB4N6719101A4N0E"; + device = baseDevice; content = { type = "gpt"; partitions = { BOOT = { + device = "${baseDevice}-part1"; type = "EF00"; start = "0"; end = "4G"; @@ -19,6 +22,7 @@ }; }; swap = { + device = "${baseDevice}-part2"; start = "5G"; end = "21G"; content = { @@ -27,6 +31,7 @@ }; }; zfsroot = { + device = "${baseDevice}-part3"; start = "21G"; end = "100%"; content = { @@ -37,13 +42,16 @@ }; }; }; - "22" = { + "22" = let + baseDevice = "/dev/disk/by-id/nvme-SHPP41-500GM_SSB4N6719101A4N22"; + in { type = "disk"; - device = "/dev/disk/by-id/nvme-SHPP41-500GM_SSB4N6719101A4N22"; + device = baseDevice; content = { type = "gpt"; partitions = { BOOT = { + device = "${baseDevice}-part1"; type = "EF00"; start = "0"; end = "4G"; @@ -54,6 +62,7 @@ }; }; swap = { + device = "${baseDevice}-part2"; start = "5G"; end = "21G"; content = { @@ -62,6 +71,7 @@ }; }; zfsroot = { + device = "${baseDevice}-part3"; start = "21G"; end = "100%"; content = {