mirror of
https://github.com/JulienMalka/snowfield.git
synced 2025-03-30 08:40:52 +02:00
feat: expose nixosConfigurations to machines
This commit is contained in:
parent
d7e0225487
commit
73ff334895
2 changed files with 60 additions and 57 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue