From 56992b8c945d497a623fe693847c91235be1ae02 Mon Sep 17 00:00:00 2001 From: sefidel Date: Tue, 28 Dec 2021 01:11:25 +0900 Subject: initial commit --- lib/nixos_configurations_as_packages.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 lib/nixos_configurations_as_packages.nix (limited to 'lib/nixos_configurations_as_packages.nix') diff --git a/lib/nixos_configurations_as_packages.nix b/lib/nixos_configurations_as_packages.nix new file mode 100644 index 0000000..f257c6d --- /dev/null +++ b/lib/nixos_configurations_as_packages.nix @@ -0,0 +1,12 @@ +{ self, ... } @ inputs: + +let + pkgs = import inputs.nixpkgs { system = "x86_64-linux"; }; + + inherit (pkgs.lib) genAttrs mapAttrs'; + + hostNames = __attrNames self.nixosConfigurations; + attrHostNames = genAttrs hostNames (name: "nixos/config/${name}"); + configs = mapAttrs' (name: pname: { name = pname; value = self.nixosConfigurations.${name}.config.system.build.toplevel; }) attrHostNames; +in +{ x86_64-linux = configs; } -- cgit 1.4.1