From 506df9a405622e843453d93e7085d33e12e1d4fe Mon Sep 17 00:00:00 2001 From: Shahab Dogar Date: Thu, 6 Feb 2025 16:53:05 +0500 Subject: [PATCH] feat: Disko | configurable device name + adjusted boot partitions --- nixos/disko-config.nix | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/nixos/disko-config.nix b/nixos/disko-config.nix index a7976c7..e19da1d 100644 --- a/nixos/disko-config.nix +++ b/nixos/disko-config.nix @@ -1,17 +1,23 @@ { + device ? throw "Set this to your disk device, e.g. /dev/sda", + ... +}: { disko.devices = { disk = { main = { + inherit device; type = "disk"; - device = "/dev/nvme0n1"; content = { type = "gpt"; partitions = { - ESP = { - priority = 1; + boot = { + name = "boot"; + size = "1M"; + type = "EF02"; + }; + esp = { name = "ESP"; - start = "1M"; - end = "512M"; + size = "500M"; type = "EF00"; content = { type = "filesystem"; @@ -38,15 +44,26 @@ subvolumes = { "/root" = { mountpoint = "/"; - mountOptions = ["subvol=root" "compress=zstd" "noatime"]; + mountOptions = [ + "compress=zstd" + "noatime" + ]; }; "/nix" = { mountpoint = "/nix"; - mountOptions = ["subvol=nix" "compress=zstd" "noatime"]; + mountOptions = [ + "subvol=nix" + "compress=zstd" + "noatime" + ]; }; "/persistant" = { mountpoint = "/persistant"; - mountOptions = ["subvol=persistant" "compress=zstd" "noatime"]; + mountOptions = [ + "subvol=persistant" + "compress=zstd" + "noatime" + ]; }; "/swap" = { mountpoint = "/swap";