From a4075510c8f1a15212e2e5403bac5b6ac0a6b4d1 Mon Sep 17 00:00:00 2001 From: lassulus Date: Mon, 18 Dec 2023 23:38:27 +0100 Subject: [PATCH] flake: define option for clanInternals We need this to define test machines in different flake modules --- checks/backups/flake-module.nix | 2 +- flake.nix | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/checks/backups/flake-module.nix b/checks/backups/flake-module.nix index 82f45ace..097327b3 100644 --- a/checks/backups/flake-module.nix +++ b/checks/backups/flake-module.nix @@ -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 = [ diff --git a/flake.nix b/flake.nix index a515d40c..cad84578 100644 --- a/flake.nix +++ b/flake.nix @@ -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); + }; + }; + }; + }; + }; + } ]; }); }