From bdec9674449de4a253ce2be936b9a7f30b60a3a9 Mon Sep 17 00:00:00 2001 From: Johannes Kirschbauer Date: Tue, 26 Nov 2024 11:29:06 +0100 Subject: [PATCH] ClanModules/zerotier: simplify nix code --- clanModules/zerotier/shared.nix | 36 ++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/clanModules/zerotier/shared.nix b/clanModules/zerotier/shared.nix index 7f5b13d22..daaf779b4 100644 --- a/clanModules/zerotier/shared.nix +++ b/clanModules/zerotier/shared.nix @@ -25,23 +25,27 @@ let ) [ ] moons; in { - options.clan.zerotier = { - excludeHosts = lib.mkOption { - type = lib.types.listOf lib.types.str; - default = [ config.clan.core.machineName ]; - description = "Hosts that should be excluded"; + options.clan.zerotier = + let + inherit (lib.types) listOf str; + in + { + excludeHosts = lib.mkOption { + type = listOf str; + default = [ config.clan.core.machineName ]; + description = "Hosts that should be excluded"; + }; + networkIps = lib.mkOption { + type = listOf str; + default = [ ]; + description = "Extra zerotier network Ips that should be accepted"; + }; + networkIds = lib.mkOption { + type = listOf str; + default = [ ]; + description = "Extra zerotier network Ids that should be accepted"; + }; }; - networkIps = lib.mkOption { - type = lib.types.listOf lib.types.str; - default = [ ]; - description = "Extra zerotier network Ips that should be accepted"; - }; - networkIds = lib.mkOption { - type = lib.types.listOf lib.types.str; - default = [ ]; - description = "Extra zerotier network Ids that should be accepted"; - }; - }; config = { assertions = [