about summary refs log tree commit diff
path: root/lib/nixos_configurations_as_packages.nix
blob: f257c6dc1ddd072ba3a347fe470df7349c0ce497 (plain)
1
2
3
4
5
6
7
8
9
10
11
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; }