diff --git a/nix/module.nix b/nix/module.nix index 9c4c19ef72266c9f78cc82e054320650e0f6e95a..8854312edf648e59770f86544af9c79d12cc5d43 100644 --- a/nix/module.nix +++ b/nix/module.nix @@ -71,7 +71,7 @@ default = { }; description = "Attribute set of tailproxy instances"; }; }; - config = lib.mkIf (cfg != { }) { + config = lib.mkIf (cfg.instances != { }) { systemd.services = lib.mapAttrs' ( name: instanceCfg: lib.nameValuePair "tailproxy-${name}" { @@ -97,7 +97,7 @@ User = instanceCfg.user; Restart = "on-failure"; }; } - ) (lib.filterAttrs (name: instanceCfg: instanceCfg.enable) cfg); + ) (lib.filterAttrs (name: instanceCfg: instanceCfg.enable) cfg.instances); users.users = lib.mapAttrs' ( name: instanceCfg: @@ -107,10 +107,10 @@ group = instanceCfg.user; home = instanceCfg.dataDir; createHome = true; } - ) (lib.filterAttrs (name: instanceCfg: instanceCfg.enable) cfg); + ) (lib.filterAttrs (name: instanceCfg: instanceCfg.enable) cfg.instances); users.groups = lib.mapAttrs' (name: instanceCfg: lib.nameValuePair instanceCfg.user { }) ( - lib.filterAttrs (name: instanceCfg: instanceCfg.enable) cfg + lib.filterAttrs (name: instanceCfg: instanceCfg.enable) cfg.instances ); }; }