feat: expose nixosConfigurations to machines

This commit is contained in:
Julien Malka 2024-08-12 18:13:18 +02:00
parent d7e0225487
commit 73ff334895
Signed by: Luj
GPG key ID: 6FC74C847011FD83
2 changed files with 60 additions and 57 deletions

View file

@ -24,8 +24,7 @@ let
value = import inputs.nixpkgs { system = plat; };
}) machines_plats
);
in
rec {
self = rec {
nixosModules = builtins.listToAttrs (
map (x: {
@ -37,7 +36,7 @@ rec {
nixosConfigurations = builtins.mapAttrs (
name: value:
(mkMachine {
inherit name;
inherit name self;
host-config = value;
modules = nixosModules;
nixpkgs = lib.snowfield.${name}.nixpkgs_version;
@ -89,4 +88,6 @@ rec {
inherit packages;
machines = lib.mapAttrs (_: v: v.config.system.build.toplevel) nixosConfigurations;
};
}
};
in
self

View file

@ -14,6 +14,7 @@ in
nixpkgs ? inputs.nixpkgs,
system ? "x86_64-linux",
home-manager ? inputs.home-manager,
self,
}:
let
pkgs = import nixpkgs { inherit system; };
@ -23,6 +24,7 @@ import "${nixpkgs}/nixos/lib/eval-config.nix" {
lib = pkgs.lib.extend (import ./default.nix inputs);
specialArgs = {
inherit inputs;
inherit (self) nixosConfigurations;
};
modules = builtins.attrValues modules ++ [
../machines/base.nix