From 0271af0dcb523f3ec9c2fe23404b10b4e13725ad Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Thu, 26 Jun 2025 17:06:46 +0200 Subject: [PATCH] modules: move clan module to flake.modules.clan.default --- flakeModules/clan.nix | 4 +--- lib/clanTest/flake-module.nix | 3 ++- lib/default.nix | 9 --------- lib/modules/clan/default.nix | 6 ++++++ lib/modules/clan/flake-module.nix | 4 ++++ lib/modules/eval-docs.nix | 4 ++-- lib/modules/flake-module.nix | 5 ++++- lib/modules/inventory/tests/default.nix | 2 +- 8 files changed, 20 insertions(+), 17 deletions(-) create mode 100644 lib/modules/clan/flake-module.nix diff --git a/flakeModules/clan.nix b/flakeModules/clan.nix index fcf97993f..2bd595b34 100644 --- a/flakeModules/clan.nix +++ b/flakeModules/clan.nix @@ -9,8 +9,6 @@ clan-core: let inherit (lib) types; - clanLib = clan-core.clanLib; - in { # Backwards compatibility @@ -37,7 +35,7 @@ in # inventoryInterface = {}; }; modules = [ - clanLib.module + clan-core.modules.clan.default ]; }; }; diff --git a/lib/clanTest/flake-module.nix b/lib/clanTest/flake-module.nix index 213cda01f..e77364ebc 100644 --- a/lib/clanTest/flake-module.nix +++ b/lib/clanTest/flake-module.nix @@ -170,6 +170,7 @@ in { imports = [ ../test/container-test-driver/driver-module.nix + ]; options = { clanSettings = mkOption { @@ -197,7 +198,7 @@ in self = throw "set clan.directory in the test"; }; modules = [ - clanLib.module + clan-core.modules.clan.default { _prefix = [ "checks" diff --git a/lib/default.nix b/lib/default.nix index 7a7ff026e..4d001e913 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -19,15 +19,6 @@ lib.fix ( ); in { - module = { - _class = "clan"; - _module.args = { - inherit clanLib; - }; - imports = [ - ./modules/clan/default.nix - ]; - }; inherit (buildClanLib) buildClan diff --git a/lib/modules/clan/default.nix b/lib/modules/clan/default.nix index 1681e19a4..af742cbcc 100644 --- a/lib/modules/clan/default.nix +++ b/lib/modules/clan/default.nix @@ -1,4 +1,10 @@ +{ clan-core }: { + _class = "clan"; + _module.args = { + inherit clan-core; + inherit (clan-core) clanLib; + }; imports = [ ./module.nix ./interface.nix diff --git a/lib/modules/clan/flake-module.nix b/lib/modules/clan/flake-module.nix new file mode 100644 index 000000000..418f5303d --- /dev/null +++ b/lib/modules/clan/flake-module.nix @@ -0,0 +1,4 @@ +{ self, lib, ... }: +{ + flake.modules.clan.default = lib.modules.importApply ./default.nix { clan-core = self; }; +} diff --git a/lib/modules/eval-docs.nix b/lib/modules/eval-docs.nix index 0a43afd57..23d0fcec6 100644 --- a/lib/modules/eval-docs.nix +++ b/lib/modules/eval-docs.nix @@ -1,12 +1,12 @@ { pkgs, lib, - clanLib, + clan-core, }: let eval = lib.evalModules { modules = [ - clanLib.module + clan-core.modules.clan.default ]; }; evalDocs = pkgs.nixosOptionsDoc { diff --git a/lib/modules/flake-module.nix b/lib/modules/flake-module.nix index a03f618ca..2109af68a 100644 --- a/lib/modules/flake-module.nix +++ b/lib/modules/flake-module.nix @@ -9,6 +9,9 @@ let ); in { + imports = [ + ./clan/flake-module.nix + ]; perSystem = { pkgs, @@ -19,7 +22,7 @@ in let jsonDocs = import ./eval-docs.nix { inherit pkgs lib; - inherit (self) clanLib; + clan-core = self; }; in { diff --git a/lib/modules/inventory/tests/default.nix b/lib/modules/inventory/tests/default.nix index 2c00ff92c..a69731b97 100644 --- a/lib/modules/inventory/tests/default.nix +++ b/lib/modules/inventory/tests/default.nix @@ -11,7 +11,7 @@ let lib.evalModules { specialArgs = { inherit clan-core nix-darwin clanLib; }; modules = [ - ../../clan/default.nix + clan-core.modules.clan.default { self = { }; }