Merge pull request 'treewide(clanLib): rename all occurences of {clan-core,self}.lib to 'clanLib'' (#3263) from hsjobeki/clan-core:lib-cleanup into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/3263
This commit is contained in:
@@ -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 (
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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 ]; } ''
|
||||
|
||||
@@ -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" ];
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -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 =
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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__";
|
||||
|
||||
Reference in New Issue
Block a user