revert Merge pull request 'Remove clanModules/*' (#4202) from remove-modules into main Reviewed-on: https://git.clan.lol/clan/clan-core/pulls/4202 See: https://git.clan.lol/clan/clan-core/issues/4365 Not all modules are migrated. If they are not migrated, we need to write migration docs and please display the link to the migration docs
72 lines
2.0 KiB
Nix
72 lines
2.0 KiB
Nix
{
|
|
inputs.clan-core.url = "https://git.clan.lol/clan/clan-core/archive/main.tar.gz";
|
|
inputs.nixpkgs.follows = "clan-core/nixpkgs";
|
|
|
|
outputs =
|
|
{ self, clan-core, ... }:
|
|
let
|
|
# Usage see: https://docs.clan.lol
|
|
clan = clan-core.lib.clan {
|
|
inherit self;
|
|
|
|
inventory =
|
|
{ ... }:
|
|
{
|
|
meta.name = "foo";
|
|
machines.peer1 = { };
|
|
machines.admin1 = { };
|
|
services = {
|
|
legacy-module.default = {
|
|
roles.peer.machines = [ "peer1" ];
|
|
roles.admin.machines = [ "admin1" ];
|
|
};
|
|
};
|
|
|
|
instances."test" = {
|
|
module.name = "new-service";
|
|
module.input = "self";
|
|
roles.peer.machines.peer1 = { };
|
|
};
|
|
|
|
modules = {
|
|
legacy-module = ./legacy-module;
|
|
};
|
|
};
|
|
|
|
modules.new-service = {
|
|
_class = "clan.service";
|
|
manifest.name = "new-service";
|
|
roles.peer = { };
|
|
perMachine = {
|
|
nixosModule = {
|
|
# This should be generated by:
|
|
# nix run .#generate-test-vars -- checks/service-dummy-test service-dummy-test
|
|
clan.core.vars.generators.new-service = {
|
|
files.not-a-secret = {
|
|
secret = false;
|
|
deploy = true;
|
|
};
|
|
files.a-secret = {
|
|
secret = true;
|
|
deploy = true;
|
|
owner = "nobody";
|
|
group = "users";
|
|
mode = "0644";
|
|
};
|
|
script = ''
|
|
# This is a dummy script that does nothing
|
|
echo -n "not-a-secret" > $out/not-a-secret
|
|
echo -n "a-secret" > $out/a-secret
|
|
'';
|
|
};
|
|
};
|
|
};
|
|
};
|
|
};
|
|
in
|
|
{
|
|
# all machines managed by Clan
|
|
inherit (clan.config) nixosConfigurations nixosModules clanInternals;
|
|
};
|
|
}
|