Reapply "clan.core: rename clan.{deployment,networking} -> clan.core.{deployment,networking}"

This reverts commit 71009f80d8.

workaround upstream bug: https://github.com/NixOS/nixpkgs/issues/324802
This commit is contained in:
DavHau
2024-07-05 19:28:11 +07:00
parent e81906881b
commit 79d6f8e893
21 changed files with 68 additions and 37 deletions

View File

@@ -1,6 +1,6 @@
{ config, lib, ... }:
{
options.clan = {
options.clan.core = {
networking = {
targetHost = lib.mkOption {
description = ''
@@ -49,14 +49,43 @@
};
imports = [
# TODO: use mkRenamedOptionModule once this is fixed: https://github.com/NixOS/nixpkgs/issues/324802
(lib.doRename rec {
from = [
"clan"
"networking"
];
to = [
"clan"
"core"
"networking"
];
visible = false;
warn = true;
use = lib.trace "Obsolete option `${lib.showOption from}' is used. It was renamed to `${lib.showOption to}'.";
withPriority = false;
})
(lib.mkRenamedOptionModule
[
"clan"
"deployment"
]
[
"clan"
"core"
"deployment"
]
)
(lib.mkRenamedOptionModule
[
"clan"
"core"
"networking"
"deploymentAddress"
]
[
"clan"
"core"
"networking"
"targetHost"
]

View File

@@ -73,7 +73,7 @@
services
;
};
inherit (config.clan.networking) targetHost buildHost;
inherit (config.clan.core.networking) targetHost buildHost;
inherit (config.clan.deployment) requireExplicitUpdate;
};
system.clan.deployment.file = pkgs.writeText "deployment.json" (

View File

@@ -5,7 +5,7 @@
...
}:
let
cfg = config.clan.networking.zerotier;
cfg = config.clan.core.networking.zerotier;
facts = config.clan.core.facts.services.zerotier.public or { };
genMoonScript = pkgs.runCommand "genmoon" { nativeBuildInputs = [ pkgs.python3 ]; } ''
install -Dm755 ${./genmoon.py} $out/bin/genmoon
@@ -13,7 +13,7 @@ let
'';
in
{
options.clan.networking.zerotier = {
options.clan.core.networking.zerotier = {
networkId = lib.mkOption {
type = lib.types.nullOr lib.types.str;
default = null;
@@ -231,8 +231,8 @@ in
};
})
(lib.mkIf (cfg.controller.enable && (facts.zerotier-network-id.value or null) != null) {
clan.networking.zerotier.networkId = facts.zerotier-network-id.value;
clan.networking.zerotier.settings = {
clan.core.networking.zerotier.networkId = facts.zerotier-network-id.value;
clan.core.networking.zerotier.settings = {
authTokens = [ null ];
authorizationEndpoint = "";
capabilities = [ ];