Merge pull request #93892 from flokli/yubikey-agent-mod-fix

nixos/yubikey-agent: add missing mkIf
This commit is contained in:
Maximilian Bosch 2020-07-26 09:51:00 +02:00 committed by GitHub
commit ef672a44a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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