mirror of
https://github.com/nix-community/home-manager.git
synced 2026-10-03 12:09:19 +00:00
PR #9420 added set-SSH_AUTH_SOCK.service and ordered it before sshAuthSock.systemd.socketProviderUnit. When that provider is a socket unit, systemd default dependencies already order the socket before sockets.target while service defaults place set-SSH_AUTH_SOCK.service after basic.target. That creates a sockets.target -> basic.target -> set-SSH_AUTH_SOCK.service -> provider.socket -> sockets.target cycle. For gpg-agent this makes systemd drop gpg-agent-ssh.socket, leaving SSH_AUTH_SOCK pointing at the expected S.gpg-agent.ssh path but with no socket listening there. Only order and install the environment service against non-socket providers. Socket providers still get SSH_AUTH_SOCK imported through default.target. Fixes #9432.
23 lines
592 B
Nix
23 lines
592 B
Nix
{ config, lib, ... }:
|
|
|
|
{
|
|
sshAuthSock = {
|
|
enable = true;
|
|
initialization = {
|
|
bash = "echo bash/zsh";
|
|
fish = "echo fish";
|
|
nushell = "echo nushell";
|
|
};
|
|
systemd.socketProviderUnit = "foo.socket";
|
|
};
|
|
|
|
nmt.script = lib.optionalString config.systemd.user.enable ''
|
|
serviceFile=home-files/.config/systemd/user/set-SSH_AUTH_SOCK.service
|
|
|
|
assertFileExists $serviceFile
|
|
assertFileContains $serviceFile 'WantedBy=default.target'
|
|
assertFileNotRegex $serviceFile 'Before=foo\.socket'
|
|
assertFileNotRegex $serviceFile 'WantedBy=foo\.socket'
|
|
'';
|
|
}
|