From 3f7d4343fccc1499061410486693e32208e5799d Mon Sep 17 00:00:00 2001 From: Leonhard Kost Date: Thu, 21 May 2026 10:30:53 +0200 Subject: [PATCH] feat: use part labels instead of uuids in hardware config --- nixos/desktop/hardware-configuration.nix | 8 ++-- nixos/server/hardware-configuration.nix | 50 ++++++++++++++---------- 2 files changed, 35 insertions(+), 23 deletions(-) diff --git a/nixos/desktop/hardware-configuration.nix b/nixos/desktop/hardware-configuration.nix index f085698..3400fae 100644 --- a/nixos/desktop/hardware-configuration.nix +++ b/nixos/desktop/hardware-configuration.nix @@ -15,12 +15,12 @@ boot.extraModulePackages = [ ]; fileSystems."/" = { - device = "/dev/disk/by-uuid/0eb29109-abd1-49af-859a-1c5009e2482f"; + device = "/dev/disk/by-label/nixos"; fsType = "ext4"; }; fileSystems."/boot" = { - device = "/dev/disk/by-uuid/EE00-3849"; + device = "/dev/disk/by-label/boot"; fsType = "vfat"; options = [ "fmask=0077" @@ -28,7 +28,9 @@ ]; }; - swapDevices = [ ]; + swapDevices = [ + { device = "/dev/disk/by-label/swap"; } + ]; # Enables DHCP on each ethernet and wireless interface. In case of scripted networking # (the default) this is the recommended approach. When using systemd-networkd it's diff --git a/nixos/server/hardware-configuration.nix b/nixos/server/hardware-configuration.nix index 696aa21..eece560 100644 --- a/nixos/server/hardware-configuration.nix +++ b/nixos/server/hardware-configuration.nix @@ -1,32 +1,42 @@ -# Do not modify this file! It was generated by ‘nixos-generate-config’ -# and may be overwritten by future invocations. Please make changes -# to /etc/nixos/configuration.nix instead. -{ config, lib, pkgs, modulesPath, ... }: +{ + config, + lib, + modulesPath, + ... +}: { - imports = - [ (modulesPath + "/installer/scan/not-detected.nix") - ]; + imports = [ + (modulesPath + "/installer/scan/not-detected.nix") + ]; - boot.initrd.availableKernelModules = [ "xhci_pci" "ahci" "usbhid" "sd_mod" ]; + boot.initrd.availableKernelModules = [ + "xhci_pci" + "ahci" + "usbhid" + "sd_mod" + ]; boot.initrd.kernelModules = [ ]; boot.kernelModules = [ ]; boot.extraModulePackages = [ ]; - fileSystems."/" = - { device = "/dev/disk/by-uuid/e9aebe22-0d9f-460f-a576-f1c44f6050b0"; - fsType = "ext4"; - }; + fileSystems."/" = { + device = "/dev/disk/by-label/nixos"; + fsType = "ext4"; + }; - fileSystems."/boot" = - { device = "/dev/disk/by-uuid/4705-B811"; - fsType = "vfat"; - options = [ "fmask=0077" "dmask=0077" ]; - }; - - swapDevices = - [ { device = "/dev/disk/by-uuid/a81582c7-be0f-4070-b3e8-64e24b8483d2"; } + fileSystems."/boot" = { + device = "/dev/disk/by-label/boot"; + fsType = "vfat"; + options = [ + "fmask=0077" + "dmask=0077" ]; + }; + + swapDevices = [ + { device = "/dev/disk/by-label/swap"; } + ]; nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux"; hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;