From be9b118f798df92252dbc2796a26c0daded95c0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Tue, 26 Sep 2023 17:31:45 +0200 Subject: [PATCH] move zerotier secret generation into nixos module --- nixosModules/clanCore/zerotier/default.nix | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nixosModules/clanCore/zerotier/default.nix b/nixosModules/clanCore/zerotier/default.nix index 5d293acdd..1bf518706 100644 --- a/nixosModules/clanCore/zerotier/default.nix +++ b/nixosModules/clanCore/zerotier/default.nix @@ -45,8 +45,8 @@ in { options.clan.networking.zerotier = { networkId = lib.mkOption { - type = lib.types.str; - default = config.clanCore.secrets.zerotier.facts."zerotier-network-id".value; + type = lib.nullOr lib.types.str; + default = null; description = '' zerotier networking id ''; @@ -87,6 +87,7 @@ in }; }) (lib.mkIf cfg.controller.enable { + clan.networking.zerotier.networkId = lib.mkDefault config.clanCore.secrets.zerotier.facts."zerotier-network-id".value; # only the controller needs to have the key in the repo, the other clients can be dynamic # we generate the zerotier code manually for the controller, since it's part of the bootstrap command clanCore.secrets.zerotier = {