Open SolidRhino opened 2 months ago
Here's the nix-darwin config I used to start the daemon:
launchd.user.agents.atuin = {
command = "${pkgs.atuin}/bin/atuin daemon";
serviceConfig = {
RunAtLoad = true;
StandardOutPath = "/tmp/atuin.log";
};
};
The following (via atuinsh/atuin#2039) uses the daemon feature. This ought to be supported in the linux version.
systemd.user.services.atuin-daemon = { Unit = { Description = "atuin shell history daemon"; Requires = [ "atuin-daemon.socket" ]; }; Service = { ExecStart = "${lib.getExe pkgs.atuin} daemon"; Environment = [ "ATUIN_LOG=info" ]; Restart = "on-failure"; RestartSteps = 5; RestartMaxDelaySec = 10; }; Install = { Also = [ "atuin-daemon.socket" ]; WantedBy = [ "default.target" ]; }; }; systemd.user.sockets.atuin-daemon = { Unit = { Description = "Unix socket activation for atuin shell history daemon"; }; Socket = { ListenStream = "%t/atuin.socket"; SocketMode = "0600"; RemoveOnStop = true; }; Install = { WantedBy = [ "sockets.target" ]; }; };
The settings.daemon
configuration needs this, too.
socket_path = "/run/user/1000/atuin.socket"; systemd_socket = true;
I'm about to test: if it's fine, I can contribute.
Oh man I didn't see this, I just made a PR! #5946, it's pretty similar to your implementation though @dbaynard.
Ah, not my implementation but I figured I'd make the link. Glad it's similar!
I haven't tested a launchd variant, yet.
Description
Add an option to manage the Atuin daemon with a user service.
daemon