folded t480 hardware config into the flake to get rid of --impure

This commit is contained in:
2026-08-06 14:00:50 +01:00
parent a013737fbf
commit 35970bfd49
3 changed files with 49 additions and 12 deletions
+27
View File
@@ -0,0 +1,27 @@
# GENERATED FILE — do not edit by hand.
#
# Regenerate on the host itself with: nix run .#sync-hardware
#
# Produced by `nixos-generate-config --show-hardware-config --no-filesystems`.
# The --no-filesystems flag is deliberate: fileSystems and swapDevices are
# declared by hand in ./disks.nix, so regenerating this file can never clobber
# them or emit duplicates for whatever happened to be mounted at the time.
#
# Leading underscore keeps import-tree from auto-importing this as a
# flake-parts module (its filter drops any path containing "/_"); it is
# imported explicitly from ./default.nix instead.
{ config, lib, pkgs, modulesPath, ... }:
{
imports =
[ (modulesPath + "/installer/scan/not-detected.nix")
];
boot.initrd.availableKernelModules = [ "xhci_pci" "nvme" "usb_storage" "usbhid" "sd_mod" ];
boot.initrd.kernelModules = [ ];
boot.kernelModules = [ "kvm-intel" ];
boot.extraModulePackages = [ ];
nixpkgs.hostPlatform = lib.mkDefault "x86_64-linux";
hardware.cpu.intel.updateMicrocode = lib.mkDefault config.hardware.enableRedistributableFirmware;
}
+3 -12
View File
@@ -5,19 +5,10 @@
}: {
flake.nixosConfigurations.t480 = inputs.nixpkgs.lib.nixosSystem {
modules = with self.nixosModules; [
# TODO: still importing by absolute path, so evaluating t480 requires
# --impure and picks up the hardware file of whatever machine you build
# from (on shadow, that means shadow's disk UUIDs — wrong but harmless
# until you actually deploy). Fix by running, ON THE T480 ITSELF:
#
# nix run .#sync-hardware
#
# then create modules/hosts/t480/disks.nix (mirroring shadow's) and swap
# this line for `./_hardware.nix` + `t480Disks`. Cannot be done remotely:
# the hardware scan has to happen on the target machine.
/etc/nixos/hardware-configuration.nix
desktop
./_hardware.nix
t480Disks
t480Configuration
desktop
# CPU microcode + integrated Intel GPU. The T480 also has an NVIDIA MX150;
# to enable it in PRIME offload mode, swap gpuIntel for gpuNvidiaPrime
# (which includes gpuIntel). Left on Intel-only by default to save power.
+19
View File
@@ -0,0 +1,19 @@
{...}: {
flake.nixosModules.t480Disks = {...}: {
fileSystems = {
"/" = {
device = "/dev/disk/by-uuid/25316a27-6846-4922-8a45-854b9e40a19f";
fsType = "ext4";
};
"/boot" = {
device = "/dev/disk/by-uuid/562C-B760";
fsType = "vfat";
options = [ "fmask=0077" "dmask=0077" ];
};
};
swapDevices = [
{ device = "/dev/disk/by-uuid/54e31e3a-af6a-4fd6-8101-4c168d3e482a"; }
];
};
}