flake.nix: passthru machine config, pkgs and config.system.build

This shortens down the path needed to build both overlayed packages and
all the other machine derivations. Here are some examples:

```
nix build .#machine.etc
nix build '.#machine.units."nginx.service".unit'
nix build .#machine.pkgs.overlayed-package
nix build .#machine.config.services.nginx.package
```
This commit is contained in:
h7x4
2026-06-17 08:10:13 +09:00
parent d84cc73819
commit 374d9b1bc7
+6 -1
View File
@@ -369,7 +369,12 @@
// //
# Machines # Machines
lib.genAttrs allMachines lib.genAttrs allMachines
(machine: self.nixosConfigurations.${machine}.config.system.build.toplevel) (machine: self.nixosConfigurations.${machine}.config.system.build.toplevel.overrideAttrs (prev: {
passthru =
(prev.passthru or { })
// self.nixosConfigurations.${machine}.config.system.build
// { inherit (self.nixosConfigurations.${machine}) pkgs config; };
}))
// //
# Nix-topology # Nix-topology
(let (let