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 (pkgs) lib;
|
||||||
inherit (lib) mkOption flip mapAttrs;
|
inherit (lib) mkOption flip mapAttrs;
|
||||||
inherit (lib.types) path raw;
|
inherit (lib.types) path raw;
|
||||||
inherit (self.lib.inventory) buildInventory;
|
inherit (self.clanLib.inventory) buildInventory;
|
||||||
nixos-lib = import (pkgs.path + "/nixos/lib") { };
|
nixos-lib = import (pkgs.path + "/nixos/lib") { };
|
||||||
in
|
in
|
||||||
(nixos-lib.runTest (
|
(nixos-lib.runTest (
|
||||||
|
|||||||
@@ -15,8 +15,8 @@
|
|||||||
inherit (self) clanModules;
|
inherit (self) clanModules;
|
||||||
clan-core = self;
|
clan-core = self;
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
evalClanModules = self.lib.evalClan.evalClanModules;
|
evalClanModules = self.clanLib.evalClan.evalClanModules;
|
||||||
modulesRolesOptions = self.lib.evalClan.evalClanModulesWithRoles {
|
modulesRolesOptions = self.clanLib.evalClan.evalClanModulesWithRoles {
|
||||||
allModules = self.clanModules;
|
allModules = self.clanModules;
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
clan-core = self;
|
clan-core = self;
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
# Frontmatter for clanModules
|
# Frontmatter for clanModules
|
||||||
clanModulesFrontmatter =
|
clanModulesFrontmatter =
|
||||||
let
|
let
|
||||||
docs = pkgs.nixosOptionsDoc { options = self.lib.modules.frontmatterOptions; };
|
docs = pkgs.nixosOptionsDoc { options = self.clanLib.modules.frontmatterOptions; };
|
||||||
in
|
in
|
||||||
docs.optionsJSON;
|
docs.optionsJSON;
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ in
|
|||||||
inherit lib;
|
inherit lib;
|
||||||
inherit (inputs) nixpkgs;
|
inherit (inputs) nixpkgs;
|
||||||
clan-core = self;
|
clan-core = self;
|
||||||
buildClan = self.lib.buildClan;
|
buildClan = self.clanLib.buildClan;
|
||||||
};
|
};
|
||||||
checks = {
|
checks = {
|
||||||
lib-build-clan-eval = pkgs.runCommand "tests" { nativeBuildInputs = [ pkgs.nix-unit ]; } ''
|
lib-build-clan-eval = pkgs.runCommand "tests" { nativeBuildInputs = [ pkgs.nix-unit ]; } ''
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ let
|
|||||||
|
|
||||||
inherit (config.clanInternals) inventory;
|
inherit (config.clanInternals) inventory;
|
||||||
|
|
||||||
inherit (clan-core.lib.inventory) buildInventory;
|
inherit (clan-core.clanLib.inventory) buildInventory;
|
||||||
|
|
||||||
supportedSystems = [
|
supportedSystems = [
|
||||||
"x86_64-linux"
|
"x86_64-linux"
|
||||||
@@ -254,7 +254,7 @@ in
|
|||||||
inherit darwinConfigurations;
|
inherit darwinConfigurations;
|
||||||
|
|
||||||
clanInternals = {
|
clanInternals = {
|
||||||
moduleSchemas = clan-core.lib.modules.getModulesSchema config.inventory.modules;
|
moduleSchemas = clan-core.clanLib.modules.getModulesSchema config.inventory.modules;
|
||||||
inherit inventoryClass;
|
inherit inventoryClass;
|
||||||
distributedServices = clan-core.clanLib.inventory.mapInstances {
|
distributedServices = clan-core.clanLib.inventory.mapInstances {
|
||||||
inherit inventory;
|
inherit inventory;
|
||||||
@@ -268,7 +268,7 @@ in
|
|||||||
inherit inventoryFile;
|
inherit inventoryFile;
|
||||||
inventoryValuesPrios =
|
inventoryValuesPrios =
|
||||||
# Temporary workaround
|
# 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 are freeformType which is not supported yet.
|
||||||
[ "tags" ];
|
[ "tags" ];
|
||||||
|
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ let
|
|||||||
roles =
|
roles =
|
||||||
if builtins.elem "inventory" frontmatter.features or [ ] then
|
if builtins.elem "inventory" frontmatter.features or [ ] then
|
||||||
assert lib.isPath module;
|
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
|
else
|
||||||
[ ];
|
[ ];
|
||||||
in
|
in
|
||||||
|
|||||||
@@ -6,16 +6,16 @@
|
|||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
|
|
||||||
modulesSchema = self.lib.modules.getModulesSchema {
|
modulesSchema = self.clanLib.modules.getModulesSchema {
|
||||||
modules = self.clanModules;
|
modules = self.clanModules;
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
clan-core = self;
|
clan-core = self;
|
||||||
};
|
};
|
||||||
|
|
||||||
jsonLib = self.lib.jsonschema { inherit includeDefaults; };
|
jsonLib = self.clanLib.jsonschema { inherit includeDefaults; };
|
||||||
includeDefaults = true;
|
includeDefaults = true;
|
||||||
|
|
||||||
frontMatterSchema = jsonLib.parseOptions self.lib.modules.frontmatterOptions { };
|
frontMatterSchema = jsonLib.parseOptions self.clanLib.modules.frontmatterOptions { };
|
||||||
|
|
||||||
inventorySchema = jsonLib.parseModule (import ../build-inventory/interface.nix);
|
inventorySchema = jsonLib.parseModule (import ../build-inventory/interface.nix);
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
builtins.fromJSON (builtins.readFile ./clan_attrs.json)
|
builtins.fromJSON (builtins.readFile ./clan_attrs.json)
|
||||||
else
|
else
|
||||||
{ };
|
{ };
|
||||||
clan = clan-core.lib.buildClan {
|
clan = clan-core.clanLib.buildClan {
|
||||||
inherit self;
|
inherit self;
|
||||||
meta.name = "test_flake_with_core";
|
meta.name = "test_flake_with_core";
|
||||||
machines = {
|
machines = {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
outputs =
|
outputs =
|
||||||
{ self, clan-core }:
|
{ self, clan-core }:
|
||||||
let
|
let
|
||||||
clan = clan-core.lib.buildClan {
|
clan = clan-core.clanLib.buildClan {
|
||||||
inherit self;
|
inherit self;
|
||||||
meta.name = "test_flake_with_core_and_pass";
|
meta.name = "test_flake_with_core_and_pass";
|
||||||
machines = {
|
machines = {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
outputs =
|
outputs =
|
||||||
{ self, clan-core }:
|
{ self, clan-core }:
|
||||||
let
|
let
|
||||||
clan = clan-core.lib.buildClan {
|
clan = clan-core.clanLib.buildClan {
|
||||||
inherit self;
|
inherit self;
|
||||||
meta.name = "test_flake_with_core_dynamic_machines";
|
meta.name = "test_flake_with_core_dynamic_machines";
|
||||||
machines =
|
machines =
|
||||||
|
|||||||
@@ -86,8 +86,8 @@
|
|||||||
# only adding clanCoreWithVendoredDeps to the nix store is not enough
|
# only adding clanCoreWithVendoredDeps to the nix store is not enough
|
||||||
templateDerivation = pkgs.closureInfo {
|
templateDerivation = pkgs.closureInfo {
|
||||||
rootPaths =
|
rootPaths =
|
||||||
builtins.attrValues (self.lib.select "clan.templates.clan.*.path" self)
|
builtins.attrValues (self.clanLib.select "clan.templates.clan.*.path" self)
|
||||||
++ builtins.attrValues (self.lib.select "clan.templates.machine.*.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
|
# 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
|
# 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, ... }:
|
{ self, clan-core, ... }:
|
||||||
let
|
let
|
||||||
# Usage see: https://docs.clan.lol
|
# Usage see: https://docs.clan.lol
|
||||||
clan = clan-core.lib.buildClan { inherit self; };
|
clan = clan-core.clanLib.buildClan { inherit self; };
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
# all machines managed by Clan
|
# all machines managed by Clan
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
{ self, clan-core, ... }:
|
{ self, clan-core, ... }:
|
||||||
let
|
let
|
||||||
# Usage see: https://docs.clan.lol
|
# Usage see: https://docs.clan.lol
|
||||||
clan = clan-core.lib.buildClan {
|
clan = clan-core.clanLib.buildClan {
|
||||||
inherit self;
|
inherit self;
|
||||||
# Ensure this is unique among all clans you want to use.
|
# Ensure this is unique among all clans you want to use.
|
||||||
meta.name = "__CHANGE_ME__";
|
meta.name = "__CHANGE_ME__";
|
||||||
|
|||||||
Reference in New Issue
Block a user