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
52 lines
1.4 KiB
Nix
52 lines
1.4 KiB
Nix
{
|
|
pkgs,
|
|
config,
|
|
lib,
|
|
...
|
|
}:
|
|
{
|
|
options = {
|
|
clan.mycelium.openFirewall = lib.mkOption {
|
|
type = lib.types.bool;
|
|
default = true;
|
|
description = "Open the firewall for mycelium";
|
|
};
|
|
|
|
clan.mycelium.addHostedPublicNodes = lib.mkOption {
|
|
type = lib.types.bool;
|
|
default = true;
|
|
description = "Add hosted Public nodes";
|
|
};
|
|
};
|
|
|
|
config.warnings = [
|
|
"The clan.mycelium module is deprecated and will be removed on 2025-07-15.
|
|
Please migrate to user-maintained configuration or the new equivalent clan services
|
|
(https://docs.clan.lol/reference/clanServices)."
|
|
];
|
|
|
|
config.services.mycelium = {
|
|
enable = true;
|
|
addHostedPublicNodes = lib.mkDefault config.clan.mycelium.addHostedPublicNodes;
|
|
openFirewall = lib.mkDefault config.clan.mycelium.openFirewall;
|
|
keyFile = config.clan.core.vars.generators.mycelium.files.key.path;
|
|
};
|
|
|
|
config.clan.core.vars.generators.mycelium = {
|
|
files."key" = { };
|
|
files."ip".secret = false;
|
|
files."pubkey".secret = false;
|
|
runtimeInputs = [
|
|
pkgs.mycelium
|
|
pkgs.coreutils
|
|
pkgs.jq
|
|
];
|
|
script = ''
|
|
timeout 5 mycelium --key-file "$out"/key || :
|
|
mycelium inspect --key-file "$out"/key --json | jq -r .publicKey > "$out"/pubkey
|
|
mycelium inspect --key-file "$out"/key --json | jq -r .address > "$out"/ip
|
|
'';
|
|
};
|
|
|
|
}
|