From 374d9b1bc756ba3e1915a5958ed57b08c80cf6a5 Mon Sep 17 00:00:00 2001 From: h7x4 Date: Wed, 17 Jun 2026 08:10:13 +0900 Subject: [PATCH] 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 ``` --- flake.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index b78a3dc..96fefb5 100644 --- a/flake.nix +++ b/flake.nix @@ -369,7 +369,12 @@ // # Machines 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 (let