flake: define option for clanInternals

We need this to define test machines in different flake modules
This commit is contained in:
lassulus
2023-12-18 23:38:27 +01:00
parent 40124d707d
commit f932dab29c
2 changed files with 18 additions and 2 deletions

View File

@@ -14,7 +14,7 @@ let
in
{
flake.nixosConfigurations = { inherit (clan.nixosConfigurations) test_backup_client; };
flake.clanInternals = clan.clanInternals;
flake.clanInternals.machines = clan.clanInternals.machines;
flake.nixosModules = {
test_backup_server = { ... }: {
imports = [

View File

@@ -24,7 +24,7 @@
};
outputs = inputs @ { flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } ({ ... }: {
flake-parts.lib.mkFlake { inherit inputs; } ({ lib, ... }: {
systems = [
"x86_64-linux"
"aarch64-linux"
@@ -41,6 +41,22 @@
./lib/flake-module.nix
./nixosModules/flake-module.nix
{
options.flake = flake-parts.lib.mkSubmoduleOptions {
clanInternals = lib.mkOption {
type = lib.types.submodule {
options = {
all-machines-json = lib.mkOption {
type = lib.types.attrsOf lib.types.str;
};
machines = lib.mkOption {
type = lib.types.attrsOf (lib.types.attrsOf lib.types.unspecified);
};
};
};
};
};
}
];
});
}