home: rbw: add a service
This commit is contained in:
parent
530dc5a3c2
commit
1644a30ce0
23
home/rbw.nix
23
home/rbw.nix
|
@ -25,5 +25,28 @@ in {
|
||||||
pinentry = pkgs.pinentry-gnome;
|
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";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue