From a6a79e83a0e8e36d53845ac48a7aabf1c742b439 Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Wed, 9 Apr 2025 11:32:46 +0200 Subject: [PATCH] treewide(clanLib): rename all occurences of {clan-core,self}.lib to 'clanLib' --- checks/lib/test-inventory.nix | 2 +- docs/nix/flake-module.nix | 6 +++--- lib/build-clan/flake-module.nix | 2 +- lib/build-clan/module.nix | 6 +++--- lib/inventory/eval-clan-modules/default.nix | 2 +- lib/inventory/schemas/default.nix | 6 +++--- pkgs/clan-cli/clan_cli/tests/test_flake_with_core/flake.nix | 2 +- .../clan_cli/tests/test_flake_with_core_and_pass/flake.nix | 2 +- .../tests/test_flake_with_core_dynamic_machines/flake.nix | 2 +- pkgs/clan-cli/flake-module.nix | 4 ++-- templates/clan/minimal/flake.nix | 2 +- templates/clan/new-clan/flake.nix | 2 +- 12 files changed, 19 insertions(+), 19 deletions(-) diff --git a/checks/lib/test-inventory.nix b/checks/lib/test-inventory.nix index 94d7f2675..a9c740bc7 100644 --- a/checks/lib/test-inventory.nix +++ b/checks/lib/test-inventory.nix @@ -4,7 +4,7 @@ let inherit (pkgs) lib; inherit (lib) mkOption flip mapAttrs; inherit (lib.types) path raw; - inherit (self.lib.inventory) buildInventory; + inherit (self.clanLib.inventory) buildInventory; nixos-lib = import (pkgs.path + "/nixos/lib") { }; in (nixos-lib.runTest ( diff --git a/docs/nix/flake-module.nix b/docs/nix/flake-module.nix index 0efb47bbb..767d7c4e1 100644 --- a/docs/nix/flake-module.nix +++ b/docs/nix/flake-module.nix @@ -15,8 +15,8 @@ inherit (self) clanModules; clan-core = self; inherit pkgs; - evalClanModules = self.lib.evalClan.evalClanModules; - modulesRolesOptions = self.lib.evalClan.evalClanModulesWithRoles { + evalClanModules = self.clanLib.evalClan.evalClanModules; + modulesRolesOptions = self.clanLib.evalClan.evalClanModulesWithRoles { allModules = self.clanModules; inherit pkgs; clan-core = self; @@ -26,7 +26,7 @@ # Frontmatter for clanModules clanModulesFrontmatter = let - docs = pkgs.nixosOptionsDoc { options = self.lib.modules.frontmatterOptions; }; + docs = pkgs.nixosOptionsDoc { options = self.clanLib.modules.frontmatterOptions; }; in docs.optionsJSON; diff --git a/lib/build-clan/flake-module.nix b/lib/build-clan/flake-module.nix index c9c9502e8..5cb96520a 100644 --- a/lib/build-clan/flake-module.nix +++ b/lib/build-clan/flake-module.nix @@ -29,7 +29,7 @@ in inherit lib; inherit (inputs) nixpkgs; clan-core = self; - buildClan = self.lib.buildClan; + buildClan = self.clanLib.buildClan; }; checks = { lib-build-clan-eval = pkgs.runCommand "tests" { nativeBuildInputs = [ pkgs.nix-unit ]; } '' diff --git a/lib/build-clan/module.nix b/lib/build-clan/module.nix index 9f69bf99b..9e28fee75 100644 --- a/lib/build-clan/module.nix +++ b/lib/build-clan/module.nix @@ -17,7 +17,7 @@ let inherit (config.clanInternals) inventory; - inherit (clan-core.lib.inventory) buildInventory; + inherit (clan-core.clanLib.inventory) buildInventory; supportedSystems = [ "x86_64-linux" @@ -254,7 +254,7 @@ in inherit darwinConfigurations; clanInternals = { - moduleSchemas = clan-core.lib.modules.getModulesSchema config.inventory.modules; + moduleSchemas = clan-core.clanLib.modules.getModulesSchema config.inventory.modules; inherit inventoryClass; distributedServices = clan-core.clanLib.inventory.mapInstances { inherit inventory; @@ -268,7 +268,7 @@ in inherit inventoryFile; inventoryValuesPrios = # Temporary workaround - builtins.removeAttrs (clan-core.lib.values.getPrios { options = inventory.options; }) + builtins.removeAttrs (clan-core.clanLib.values.getPrios { options = inventory.options; }) # tags are freeformType which is not supported yet. [ "tags" ]; diff --git a/lib/inventory/eval-clan-modules/default.nix b/lib/inventory/eval-clan-modules/default.nix index de944efe4..84b334635 100644 --- a/lib/inventory/eval-clan-modules/default.nix +++ b/lib/inventory/eval-clan-modules/default.nix @@ -74,7 +74,7 @@ let roles = if builtins.elem "inventory" frontmatter.features or [ ] then assert lib.isPath module; - clan-core.lib.modules.getRoles "Documentation: inventory.modules" allModules moduleName + clan-core.clanLib.modules.getRoles "Documentation: inventory.modules" allModules moduleName else [ ]; in diff --git a/lib/inventory/schemas/default.nix b/lib/inventory/schemas/default.nix index 4ebde390e..e014b190a 100644 --- a/lib/inventory/schemas/default.nix +++ b/lib/inventory/schemas/default.nix @@ -6,16 +6,16 @@ }: let - modulesSchema = self.lib.modules.getModulesSchema { + modulesSchema = self.clanLib.modules.getModulesSchema { modules = self.clanModules; inherit pkgs; clan-core = self; }; - jsonLib = self.lib.jsonschema { inherit includeDefaults; }; + jsonLib = self.clanLib.jsonschema { inherit includeDefaults; }; includeDefaults = true; - frontMatterSchema = jsonLib.parseOptions self.lib.modules.frontmatterOptions { }; + frontMatterSchema = jsonLib.parseOptions self.clanLib.modules.frontmatterOptions { }; inventorySchema = jsonLib.parseModule (import ../build-inventory/interface.nix); diff --git a/pkgs/clan-cli/clan_cli/tests/test_flake_with_core/flake.nix b/pkgs/clan-cli/clan_cli/tests/test_flake_with_core/flake.nix index 2303bb08f..7998e5818 100644 --- a/pkgs/clan-cli/clan_cli/tests/test_flake_with_core/flake.nix +++ b/pkgs/clan-cli/clan_cli/tests/test_flake_with_core/flake.nix @@ -19,7 +19,7 @@ builtins.fromJSON (builtins.readFile ./clan_attrs.json) else { }; - clan = clan-core.lib.buildClan { + clan = clan-core.clanLib.buildClan { inherit self; meta.name = "test_flake_with_core"; machines = { diff --git a/pkgs/clan-cli/clan_cli/tests/test_flake_with_core_and_pass/flake.nix b/pkgs/clan-cli/clan_cli/tests/test_flake_with_core_and_pass/flake.nix index 03715c891..73a1b4269 100644 --- a/pkgs/clan-cli/clan_cli/tests/test_flake_with_core_and_pass/flake.nix +++ b/pkgs/clan-cli/clan_cli/tests/test_flake_with_core_and_pass/flake.nix @@ -8,7 +8,7 @@ outputs = { self, clan-core }: let - clan = clan-core.lib.buildClan { + clan = clan-core.clanLib.buildClan { inherit self; meta.name = "test_flake_with_core_and_pass"; machines = { diff --git a/pkgs/clan-cli/clan_cli/tests/test_flake_with_core_dynamic_machines/flake.nix b/pkgs/clan-cli/clan_cli/tests/test_flake_with_core_dynamic_machines/flake.nix index 0a808f50b..c68f6491e 100644 --- a/pkgs/clan-cli/clan_cli/tests/test_flake_with_core_dynamic_machines/flake.nix +++ b/pkgs/clan-cli/clan_cli/tests/test_flake_with_core_dynamic_machines/flake.nix @@ -8,7 +8,7 @@ outputs = { self, clan-core }: let - clan = clan-core.lib.buildClan { + clan = clan-core.clanLib.buildClan { inherit self; meta.name = "test_flake_with_core_dynamic_machines"; machines = diff --git a/pkgs/clan-cli/flake-module.nix b/pkgs/clan-cli/flake-module.nix index c0e3b9e9e..756e3eb17 100644 --- a/pkgs/clan-cli/flake-module.nix +++ b/pkgs/clan-cli/flake-module.nix @@ -86,8 +86,8 @@ # only adding clanCoreWithVendoredDeps to the nix store is not enough templateDerivation = pkgs.closureInfo { rootPaths = - builtins.attrValues (self.lib.select "clan.templates.clan.*.path" self) - ++ builtins.attrValues (self.lib.select "clan.templates.machine.*.path" self); + builtins.attrValues (self.clanLib.select "clan.templates.clan.*.path" self) + ++ builtins.attrValues (self.clanLib.select "clan.templates.machine.*.path" self); # FIXME: As the templates get modified in clanCoreWithVendoredDeps below, we need to add the modified version to the nix store too # However it is not possible (or I don't know how) to add a nix path from a built derivation to the nix store diff --git a/templates/clan/minimal/flake.nix b/templates/clan/minimal/flake.nix index d156c1656..868e304a6 100644 --- a/templates/clan/minimal/flake.nix +++ b/templates/clan/minimal/flake.nix @@ -6,7 +6,7 @@ { self, clan-core, ... }: let # Usage see: https://docs.clan.lol - clan = clan-core.lib.buildClan { inherit self; }; + clan = clan-core.clanLib.buildClan { inherit self; }; in { # all machines managed by Clan diff --git a/templates/clan/new-clan/flake.nix b/templates/clan/new-clan/flake.nix index 56edd55fa..74be24c73 100644 --- a/templates/clan/new-clan/flake.nix +++ b/templates/clan/new-clan/flake.nix @@ -6,7 +6,7 @@ { self, clan-core, ... }: let # Usage see: https://docs.clan.lol - clan = clan-core.lib.buildClan { + clan = clan-core.clanLib.buildClan { inherit self; # Ensure this is unique among all clans you want to use. meta.name = "__CHANGE_ME__";