From c51eb2acb04cead94fa2420ae7331e300fb31bbe Mon Sep 17 00:00:00 2001 From: Magic_RB Date: Tue, 13 Jun 2023 23:00:56 +0200 Subject: [PATCH] Add `nixngConfigurations` option Signed-off-by: Magic_RB --- flake.nix | 2 ++ modules/nixngConfigurations.nix | 29 +++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 modules/nixngConfigurations.nix diff --git a/flake.nix b/flake.nix index 03efc46..e687437 100644 --- a/flake.nix +++ b/flake.nix @@ -39,6 +39,8 @@ outputs = inputs@{ flake-parts, self, ... }: flake-parts.lib.mkFlake { inherit inputs; } ({ config, ... }: { imports = [ + modules/nixngConfigurations.nix + nixos/systems/omen nixos/systems/heater nixos/systems/toothpick diff --git a/modules/nixngConfigurations.nix b/modules/nixngConfigurations.nix new file mode 100644 index 0000000..cfef8c7 --- /dev/null +++ b/modules/nixngConfigurations.nix @@ -0,0 +1,29 @@ +# copied straight from https://github.com/hercules-ci/flake-parts/blob/main/modules/nixosConfigurations.nix +{ lib, flake-parts-lib, ... }: +let + inherit (lib) + mkOption + types + literalExpression + ; + inherit (flake-parts-lib) + mkSubmoduleOptions + ; +in +{ + options = { + flake = mkSubmoduleOptions { + nixngConfigurations = mkOption { + type = types.lazyAttrsOf types.raw; + default = { }; + description = '' + Instantiated NixNG configurations. + `nixngConfigurations` is for specific machines. If you want to expose + reusable configurations, add them to [`nixosModules`](#opt-flake.nixosModules) + in the form of modules (no `lib.nixosSystem`), so that you can reference + them in this or another flake's `nixngConfigurations`. + ''; + }; + }; + }; +}