Merge pull request 'buildClan: replace all usages by lib.clan' (#4167) from build-clan into main
Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4167
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
{ self, clan-core, ... }:
|
||||
let
|
||||
# Usage see: https://docs.clan.lol
|
||||
clan = clan-core.clanLib.buildClan {
|
||||
clan = clan-core.lib.clan {
|
||||
inherit self;
|
||||
|
||||
inventory =
|
||||
@@ -66,6 +66,6 @@
|
||||
in
|
||||
{
|
||||
# all machines managed by Clan
|
||||
inherit (clan) nixosConfigurations nixosModules clanInternals;
|
||||
inherit (clan.config) nixosConfigurations nixosModules clanInternals;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
...
|
||||
}:
|
||||
let
|
||||
testFlake = clanLib.buildClan {
|
||||
testFlake = clanLib.clan {
|
||||
# Point to the folder of the module
|
||||
# TODO: make this optional
|
||||
directory = ./..;
|
||||
@@ -43,7 +43,7 @@ let
|
||||
in
|
||||
{
|
||||
test_simple = {
|
||||
inherit testFlake;
|
||||
config = testFlake.config;
|
||||
|
||||
expr = { };
|
||||
expected = { };
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
...
|
||||
}:
|
||||
let
|
||||
testFlake = clanLib.buildClan {
|
||||
testFlake = clanLib.clan {
|
||||
# Point to the folder of the module
|
||||
# TODO: make this optional
|
||||
directory = ./..;
|
||||
@@ -47,7 +47,7 @@ in
|
||||
inherit testFlake;
|
||||
|
||||
expr =
|
||||
testFlake.clan.clanInternals.inventoryClass.distributedServices.importedModulesEvaluated.self-wifi.config;
|
||||
testFlake.config.clan.clanInternals.inventoryClass.distributedServices.importedModulesEvaluated.self-wifi.config;
|
||||
expected = 1;
|
||||
|
||||
# expr = {
|
||||
|
||||
@@ -4,7 +4,8 @@
|
||||
...
|
||||
}:
|
||||
let
|
||||
testFlake = clanLib.buildClan {
|
||||
testFlake =
|
||||
(clanLib.clan {
|
||||
directory = ./vm;
|
||||
|
||||
machines.jon = {
|
||||
@@ -29,7 +30,7 @@ let
|
||||
roles.controller.machines.bam = { };
|
||||
};
|
||||
};
|
||||
};
|
||||
}).config;
|
||||
in
|
||||
{
|
||||
test_peers = {
|
||||
|
||||
@@ -31,9 +31,7 @@ in
|
||||
# Run: nix-unit --extra-experimental-features flakes --flake .#legacyPackages.x86_64-linux.evalTests-build-clan
|
||||
legacyPackages.evalTests-build-clan = import ./tests.nix {
|
||||
inherit lib;
|
||||
inherit (inputs) nixpkgs;
|
||||
clan-core = self;
|
||||
buildClan = self.clanLib.buildClan;
|
||||
};
|
||||
checks = {
|
||||
eval-lib-build-clan = pkgs.runCommand "tests" { nativeBuildInputs = [ pkgs.nix-unit ]; } ''
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{
|
||||
lib,
|
||||
clan-core,
|
||||
...
|
||||
}:
|
||||
let
|
||||
# Shallowly force all attribute values to be evaluated.
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
builtins.fromJSON (builtins.readFile ./clan_attrs.json)
|
||||
else
|
||||
{ };
|
||||
clan = clan-core.clanLib.buildClan {
|
||||
clan = clan-core.lib.clan {
|
||||
inherit self;
|
||||
meta.name = "test_flake_with_core";
|
||||
# Don't quote this will be replaced by the inventory expression
|
||||
@@ -62,6 +62,6 @@
|
||||
in
|
||||
{
|
||||
clan = clan_attrs_json;
|
||||
inherit (clan) nixosConfigurations nixosModules clanInternals;
|
||||
inherit (clan.config) nixosConfigurations nixosModules clanInternals;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
outputs =
|
||||
{ self, clan-core }:
|
||||
let
|
||||
clan = clan-core.clanLib.buildClan {
|
||||
clan = clan-core.lib.clan {
|
||||
inherit self;
|
||||
meta.name = "test_flake_with_core_and_pass";
|
||||
machines = {
|
||||
@@ -44,6 +44,6 @@
|
||||
};
|
||||
in
|
||||
{
|
||||
inherit (clan) nixosConfigurations nixosModules clanInternals;
|
||||
inherit (clan.config) nixosConfigurations nixosModules clanInternals;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
outputs =
|
||||
{ self, clan-core }:
|
||||
let
|
||||
clan = clan-core.clanLib.buildClan {
|
||||
clan = clan-core.lib.clan {
|
||||
inherit self;
|
||||
meta.name = "test_flake_with_core_dynamic_machines";
|
||||
machines =
|
||||
@@ -19,6 +19,6 @@
|
||||
};
|
||||
in
|
||||
{
|
||||
inherit (clan) nixosConfigurations nixosModules clanInternals;
|
||||
inherit (clan.config) nixosConfigurations nixosModules clanInternals;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
{ self, clan-core, ... }:
|
||||
let
|
||||
# Usage see: https://docs.clan.lol
|
||||
clan = clan-core.clanLib.buildClan { inherit self; };
|
||||
clan = clan-core.lib.clan { inherit self; };
|
||||
in
|
||||
{
|
||||
# all machines managed by Clan
|
||||
inherit (clan) nixosConfigurations nixosModules clanInternals;
|
||||
inherit (clan.config) nixosConfigurations nixosModules clanInternals;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
{ self, clan-core, ... }:
|
||||
let
|
||||
# Usage see: https://docs.clan.lol
|
||||
clan = clan-core.clanLib.buildClan {
|
||||
clan = clan-core.lib.clan {
|
||||
inherit self;
|
||||
# Ensure this is unique among all clans you want to use.
|
||||
meta.name = "__CHANGE_ME__";
|
||||
@@ -26,7 +26,7 @@
|
||||
};
|
||||
in
|
||||
{
|
||||
inherit (clan) nixosConfigurations nixosModules clanInternals;
|
||||
inherit (clan.config) nixosConfigurations nixosModules clanInternals;
|
||||
# Add the Clan cli tool to the dev shell.
|
||||
# Use "nix develop" to enter the dev shell.
|
||||
devShells =
|
||||
|
||||
Reference in New Issue
Block a user