nixos/yubikey-agent: start enabled agent on boot
This adds a `wantedBy` clause to the user systemd service for yubikey-agent, to ensure an enabled agent is started on boot. This brings the behavior inline with existing documentation. If the user has selected a graphical pinentry program, then we need to wait for the graphical environment to exist before starting the yubikey-agent. I've found that if we start the agent earlier it will fail when we perform an ssh command later.
This commit is contained in:
@@ -49,6 +49,12 @@ in
|
|||||||
# yubikey-agent package
|
# yubikey-agent package
|
||||||
systemd.user.services.yubikey-agent = mkIf (pinentryFlavor != null) {
|
systemd.user.services.yubikey-agent = mkIf (pinentryFlavor != null) {
|
||||||
path = [ pkgs.pinentry.${pinentryFlavor} ];
|
path = [ pkgs.pinentry.${pinentryFlavor} ];
|
||||||
|
wantedBy = [
|
||||||
|
(if pinentryFlavor == "tty" || pinentryFlavor == "curses" then
|
||||||
|
"default.target"
|
||||||
|
else
|
||||||
|
"graphical-session.target")
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
environment.extraInit = ''
|
environment.extraInit = ''
|
||||||
|
|||||||
Reference in New Issue
Block a user