diff --git a/modules/misc/ssh-auth-sock.nix b/modules/misc/ssh-auth-sock.nix index dc54c255c..b9f7f7e81 100644 --- a/modules/misc/ssh-auth-sock.nix +++ b/modules/misc/ssh-auth-sock.nix @@ -63,38 +63,11 @@ in type = with lib.types; nullOr (submodule initSubmodule); }; - config = lib.mkMerge [ - { - assertions = [ - { - assertion = - lib.count (x: x) [ - (config.services.ssh-agent.enable || config.services.ssh-tpm-agent.enable) - (config.services.gpg-agent.enable && config.services.gpg-agent.enableSshSupport) - config.services.proton-pass-agent.enable - config.services.yubikey-agent.enable - ] <= 1; - message = '' - Out of the SSH agents - - - ssh-agent or ssh-tpm-agent (these two can coexist), - - gpg-agent with SSH support enabled, and - - proton-pass-agent, - - yubikey-agent, - - at most one of them may be enabled (with the exception of ssh-agent and - ssh-tpm-agent). - ''; - } - ]; - } - - (lib.mkIf (cfg.initialization != null) { - # $SSH_AUTH_SOCK has to be set early since other tools rely on it - programs.bash.profileExtra = lib.mkOrder 900 bashIntegration; - programs.fish.shellInit = lib.mkOrder 900 fishIntegration; - programs.nushell.extraConfig = lib.mkOrder 900 nushellIntegration; - programs.zsh.envExtra = lib.mkOrder 900 bashIntegration; - }) - ]; + config = lib.mkIf (cfg.initialization != null) { + # $SSH_AUTH_SOCK has to be set early since other tools rely on it + programs.bash.profileExtra = lib.mkOrder 900 bashIntegration; + programs.fish.shellInit = lib.mkOrder 900 fishIntegration; + programs.nushell.extraConfig = lib.mkOrder 900 nushellIntegration; + programs.zsh.envExtra = lib.mkOrder 900 bashIntegration; + }; } diff --git a/tests/modules/misc/ssh-auth-sock/conflicts.nix b/tests/modules/misc/ssh-auth-sock/conflicts.nix deleted file mode 100644 index 08daddd91..000000000 --- a/tests/modules/misc/ssh-auth-sock/conflicts.nix +++ /dev/null @@ -1,21 +0,0 @@ -{ - services.gpg-agent = { - enable = true; - enableSshSupport = true; - }; - services.ssh-agent.enable = true; - - test.asserts.assertions.expected = [ - '' - Out of the SSH agents - - - ssh-agent or ssh-tpm-agent (these two can coexist), - - gpg-agent with SSH support enabled, and - - proton-pass-agent, - - yubikey-agent, - - at most one of them may be enabled (with the exception of ssh-agent and - ssh-tpm-agent). - '' - ]; -} diff --git a/tests/modules/misc/ssh-auth-sock/default.nix b/tests/modules/misc/ssh-auth-sock/default.nix index 8fc2c6bb8..58d77c499 100644 --- a/tests/modules/misc/ssh-auth-sock/default.nix +++ b/tests/modules/misc/ssh-auth-sock/default.nix @@ -1,4 +1,3 @@ { - sshAuthSock-conflicts = ./conflicts.nix; sshAuthSock-initialization = ./initialization.nix; }