importing /etc/nixos/hardware-configuration.nix by absolute path from the
shared core module had two problems: it made the flake impure (every eval
needed --impure, since the file lives outside the store) and both hosts
resolved to whichever machine's file was on disk, so evaluating t480 on shadow
silently baked in shadow's disk uuids.
shadow now carries its own generated scan at modules/hosts/shadow/_hardware.nix.
the leading underscore keeps import-tree from picking it up as a flake-parts
module - its filter drops any path containing "/_" - so it is imported
explicitly from the host's default.nix.
it is generated with --no-filesystems and all of shadow's filesystems are
declared by hand in disks.nix instead. that split is what makes regeneration
safe: nixos-generate-config emits fileSystems for whatever is mounted at the
time, which would otherwise conflict with the entries below every time the data
drives happened to be mounted. `nix run .#sync-hardware` refreshes the file.
DUMP/GAMES/BAK are mounted by label at /mnt/{dump,games,bak} with
noauto + x-systemd.automount, so the two 2.7T spinners stay parked until
something touches the path and spin back down after 10 minutes idle. nofail
keeps a missing disk from dropping the boot into emergency mode.
/ and /boot are unchanged - still the same uuids, verified identical to the
previous evaluation. t480 keeps the absolute import for now with a TODO; its
scan can only be generated on the machine itself.
35 lines
1.1 KiB
Nix
35 lines
1.1 KiB
Nix
{
|
|
self,
|
|
inputs,
|
|
...
|
|
}: {
|
|
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
|
|
t480Configuration
|
|
# 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.
|
|
cpuIntel
|
|
gpuIntel
|
|
development
|
|
feishin
|
|
obsidian
|
|
discord
|
|
gaming
|
|
];
|
|
};
|
|
}
|
|
|