From 01106110fe027fd6bf93dad3f7e4652ef86321fb Mon Sep 17 00:00:00 2001 From: Jonas Rabenstein Date: Wed, 26 Nov 2025 02:40:42 +0100 Subject: [PATCH] automatically import ${namespace}.${class(es)} as modules Allow to specify a list of classes in the host/.nix (by default the class is used) that will automatically load specified outputs of inputs. --- export/nixosConfigurations.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/export/nixosConfigurations.nix b/export/nixosConfigurations.nix index f8dba98..eb8c570 100644 --- a/export/nixosConfigurations.nix +++ b/export/nixosConfigurations.nix @@ -15,6 +15,7 @@ let { namespace ? "fbs42", nixpkgs ? "nixpkgs", + classes ? [ hostname ], }: inputs.${nixpkgs}.lib.nixosSystem { specialArgs = { inherit inputs flake namespace; }; @@ -24,6 +25,9 @@ let base: builtins.attrValues (flake.lib.scan { base = "${base}/host/${hostname}"; }) ) flake.lib.schema.base ) + ++ map (class: { + imports = map (input: input.${namespace}.${class} or { }) (builtins.attrValues inputs); + }) classes ++ [ { config.networking.hostName = hostname; } ] ++ [ nixosModules.default ] ++ inputs.${nixpkgs}.lib.optional (inputs ? home-manager) { -- 2.51.2