diff --git a/nixos/modules/services/cluster/rancher/default.nix b/nixos/modules/services/cluster/rancher/default.nix index c511da5a62f5..69539aca80fe 100644 --- a/nixos/modules/services/cluster/rancher/default.nix +++ b/nixos/modules/services/cluster/rancher/default.nix @@ -826,8 +826,8 @@ let "${name}: token, tokenFile or configPath (with 'token' or 'token-file' keys) should be set if role is 'agent'" ) ++ (lib.optional ( - cfg.role == "agent" && !(cfg.agentTokenFile != null || cfg.agentToken != "") - ) "${name}: agentToken and agentToken should not be set if role is 'agent'"); + cfg.role == "agent" && (cfg.agentTokenFile != null || cfg.agentToken != "") + ) "${name}: agentToken and agentTokenFile should not be set if role is 'agent'"); environment.systemPackages = [ config.services.${name}.package ];