nixos/yubikey-agent: add missing mkIf

This accidentially added pkgs.yubikey-agent to
environment.systemPackages unconditionally.
This commit is contained in:
Florian Klink 2020-07-26 09:34:24 +02:00
parent b49e798763
commit ebfae82674

View File

@ -41,7 +41,7 @@ in
}; };
}; };
config = { config = mkIf cfg.enable {
environment.systemPackages = [ cfg.package ]; environment.systemPackages = [ cfg.package ];
systemd.packages = [ cfg.package ]; systemd.packages = [ cfg.package ];
@ -51,11 +51,10 @@ in
path = [ pkgs.pinentry.${pinentryFlavor} ]; path = [ pkgs.pinentry.${pinentryFlavor} ];
}; };
environment.extraInit = optionalString cfg.enable environment.extraInit = ''
'' if [ -z "$SSH_AUTH_SOCK" -a -n "$XDG_RUNTIME_DIR" ]; then
if [ -z "$SSH_AUTH_SOCK" -a -n "$XDG_RUNTIME_DIR" ]; then export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/yubikey-agent/yubikey-agent.sock"
export SSH_AUTH_SOCK="$XDG_RUNTIME_DIR/yubikey-agent/yubikey-agent.sock" fi
fi '';
'';
}; };
} }