home: rbw: add a service

This commit is contained in:
Antoine Martin 2022-04-11 17:15:32 +02:00
parent 530dc5a3c2
commit 1644a30ce0

View file

@ -25,5 +25,28 @@ in {
pinentry = pkgs.pinentry-gnome;
};
};
# `rbw-agent` should be launched on first call to `rbw`, so this shouldn't
# be necessary.
#
# However, if for instance `rbw` if first called by the emacs-daemon (when
# accessing an IMAP account password), then restarting the user service
# associated to the emacs daemon also kills the rbw-agent it spawned,
# resetting the lock status and prompting for a passphrase again.
#
# This user service makes sure the rbw-agent is started when the user
# session launches.
systemd.user.services.rbw = {
Unit.Description = "rbw agent autostart";
Install.WantedBy = ["default.target"];
Service = {
ExecStart = "${pkgs.rbw}/bin/rbw-agent";
Restart = "on-abort";
Type = "forking";
PIDFile = "%t/rbw/pidfile";
};
};
};
}