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, ... }:
|
{ self, clan-core, ... }:
|
||||||
let
|
let
|
||||||
# Usage see: https://docs.clan.lol
|
# Usage see: https://docs.clan.lol
|
||||||
clan = clan-core.clanLib.buildClan {
|
clan = clan-core.lib.clan {
|
||||||
inherit self;
|
inherit self;
|
||||||
|
|
||||||
inventory =
|
inventory =
|
||||||
@@ -66,6 +66,6 @@
|
|||||||
in
|
in
|
||||||
{
|
{
|
||||||
# all machines managed by Clan
|
# all machines managed by Clan
|
||||||
inherit (clan) nixosConfigurations nixosModules clanInternals;
|
inherit (clan.config) nixosConfigurations nixosModules clanInternals;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
testFlake = clanLib.buildClan {
|
testFlake = clanLib.clan {
|
||||||
# Point to the folder of the module
|
# Point to the folder of the module
|
||||||
# TODO: make this optional
|
# TODO: make this optional
|
||||||
directory = ./..;
|
directory = ./..;
|
||||||
@@ -43,7 +43,7 @@ let
|
|||||||
in
|
in
|
||||||
{
|
{
|
||||||
test_simple = {
|
test_simple = {
|
||||||
inherit testFlake;
|
config = testFlake.config;
|
||||||
|
|
||||||
expr = { };
|
expr = { };
|
||||||
expected = { };
|
expected = { };
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
testFlake = clanLib.buildClan {
|
testFlake = clanLib.clan {
|
||||||
# Point to the folder of the module
|
# Point to the folder of the module
|
||||||
# TODO: make this optional
|
# TODO: make this optional
|
||||||
directory = ./..;
|
directory = ./..;
|
||||||
@@ -47,7 +47,7 @@ in
|
|||||||
inherit testFlake;
|
inherit testFlake;
|
||||||
|
|
||||||
expr =
|
expr =
|
||||||
testFlake.clan.clanInternals.inventoryClass.distributedServices.importedModulesEvaluated.self-wifi.config;
|
testFlake.config.clan.clanInternals.inventoryClass.distributedServices.importedModulesEvaluated.self-wifi.config;
|
||||||
expected = 1;
|
expected = 1;
|
||||||
|
|
||||||
# expr = {
|
# expr = {
|
||||||
|
|||||||
@@ -4,32 +4,33 @@
|
|||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
testFlake = clanLib.buildClan {
|
testFlake =
|
||||||
directory = ./vm;
|
(clanLib.clan {
|
||||||
|
directory = ./vm;
|
||||||
|
|
||||||
machines.jon = {
|
machines.jon = {
|
||||||
nixpkgs.hostPlatform = "x86_64-linux";
|
nixpkgs.hostPlatform = "x86_64-linux";
|
||||||
};
|
|
||||||
machines.sara = {
|
|
||||||
nixpkgs.hostPlatform = "x86_64-linux";
|
|
||||||
};
|
|
||||||
machines.bam = {
|
|
||||||
nixpkgs.hostPlatform = "x86_64-linux";
|
|
||||||
};
|
|
||||||
|
|
||||||
modules.zerotier = module;
|
|
||||||
|
|
||||||
inventory.instances = {
|
|
||||||
zerotier = {
|
|
||||||
module.name = "zerotier";
|
|
||||||
module.input = "self";
|
|
||||||
|
|
||||||
roles.peer.tags.all = { };
|
|
||||||
roles.moon.machines.sara.settings.stableEndpoints = [ "10.0.0.3/9993" ];
|
|
||||||
roles.controller.machines.bam = { };
|
|
||||||
};
|
};
|
||||||
};
|
machines.sara = {
|
||||||
};
|
nixpkgs.hostPlatform = "x86_64-linux";
|
||||||
|
};
|
||||||
|
machines.bam = {
|
||||||
|
nixpkgs.hostPlatform = "x86_64-linux";
|
||||||
|
};
|
||||||
|
|
||||||
|
modules.zerotier = module;
|
||||||
|
|
||||||
|
inventory.instances = {
|
||||||
|
zerotier = {
|
||||||
|
module.name = "zerotier";
|
||||||
|
module.input = "self";
|
||||||
|
|
||||||
|
roles.peer.tags.all = { };
|
||||||
|
roles.moon.machines.sara.settings.stableEndpoints = [ "10.0.0.3/9993" ];
|
||||||
|
roles.controller.machines.bam = { };
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}).config;
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
test_peers = {
|
test_peers = {
|
||||||
|
|||||||
@@ -31,9 +31,7 @@ in
|
|||||||
# Run: nix-unit --extra-experimental-features flakes --flake .#legacyPackages.x86_64-linux.evalTests-build-clan
|
# Run: nix-unit --extra-experimental-features flakes --flake .#legacyPackages.x86_64-linux.evalTests-build-clan
|
||||||
legacyPackages.evalTests-build-clan = import ./tests.nix {
|
legacyPackages.evalTests-build-clan = import ./tests.nix {
|
||||||
inherit lib;
|
inherit lib;
|
||||||
inherit (inputs) nixpkgs;
|
|
||||||
clan-core = self;
|
clan-core = self;
|
||||||
buildClan = self.clanLib.buildClan;
|
|
||||||
};
|
};
|
||||||
checks = {
|
checks = {
|
||||||
eval-lib-build-clan = pkgs.runCommand "tests" { nativeBuildInputs = [ pkgs.nix-unit ]; } ''
|
eval-lib-build-clan = pkgs.runCommand "tests" { nativeBuildInputs = [ pkgs.nix-unit ]; } ''
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
{
|
{
|
||||||
lib,
|
lib,
|
||||||
clan-core,
|
clan-core,
|
||||||
...
|
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
# Shallowly force all attribute values to be evaluated.
|
# Shallowly force all attribute values to be evaluated.
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
builtins.fromJSON (builtins.readFile ./clan_attrs.json)
|
builtins.fromJSON (builtins.readFile ./clan_attrs.json)
|
||||||
else
|
else
|
||||||
{ };
|
{ };
|
||||||
clan = clan-core.clanLib.buildClan {
|
clan = clan-core.lib.clan {
|
||||||
inherit self;
|
inherit self;
|
||||||
meta.name = "test_flake_with_core";
|
meta.name = "test_flake_with_core";
|
||||||
# Don't quote this will be replaced by the inventory expression
|
# Don't quote this will be replaced by the inventory expression
|
||||||
@@ -62,6 +62,6 @@
|
|||||||
in
|
in
|
||||||
{
|
{
|
||||||
clan = clan_attrs_json;
|
clan = clan_attrs_json;
|
||||||
inherit (clan) nixosConfigurations nixosModules clanInternals;
|
inherit (clan.config) nixosConfigurations nixosModules clanInternals;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
outputs =
|
outputs =
|
||||||
{ self, clan-core }:
|
{ self, clan-core }:
|
||||||
let
|
let
|
||||||
clan = clan-core.clanLib.buildClan {
|
clan = clan-core.lib.clan {
|
||||||
inherit self;
|
inherit self;
|
||||||
meta.name = "test_flake_with_core_and_pass";
|
meta.name = "test_flake_with_core_and_pass";
|
||||||
machines = {
|
machines = {
|
||||||
@@ -44,6 +44,6 @@
|
|||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
inherit (clan) nixosConfigurations nixosModules clanInternals;
|
inherit (clan.config) nixosConfigurations nixosModules clanInternals;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
outputs =
|
outputs =
|
||||||
{ self, clan-core }:
|
{ self, clan-core }:
|
||||||
let
|
let
|
||||||
clan = clan-core.clanLib.buildClan {
|
clan = clan-core.lib.clan {
|
||||||
inherit self;
|
inherit self;
|
||||||
meta.name = "test_flake_with_core_dynamic_machines";
|
meta.name = "test_flake_with_core_dynamic_machines";
|
||||||
machines =
|
machines =
|
||||||
@@ -19,6 +19,6 @@
|
|||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
inherit (clan) nixosConfigurations nixosModules clanInternals;
|
inherit (clan.config) nixosConfigurations nixosModules clanInternals;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,10 +6,10 @@
|
|||||||
{ self, clan-core, ... }:
|
{ self, clan-core, ... }:
|
||||||
let
|
let
|
||||||
# Usage see: https://docs.clan.lol
|
# Usage see: https://docs.clan.lol
|
||||||
clan = clan-core.clanLib.buildClan { inherit self; };
|
clan = clan-core.lib.clan { inherit self; };
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
# all machines managed by Clan
|
# all machines managed by Clan
|
||||||
inherit (clan) nixosConfigurations nixosModules clanInternals;
|
inherit (clan.config) nixosConfigurations nixosModules clanInternals;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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.clanLib.buildClan {
|
clan = clan-core.lib.clan {
|
||||||
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__";
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
inherit (clan) nixosConfigurations nixosModules clanInternals;
|
inherit (clan.config) nixosConfigurations nixosModules clanInternals;
|
||||||
# Add the Clan cli tool to the dev shell.
|
# Add the Clan cli tool to the dev shell.
|
||||||
# Use "nix develop" to enter the dev shell.
|
# Use "nix develop" to enter the dev shell.
|
||||||
devShells =
|
devShells =
|
||||||
|
|||||||
Reference in New Issue
Block a user