atuin: run as daemon
This commit is contained in:
parent
52fe78851b
commit
026d5f813b
2 changed files with 51 additions and 1 deletions
|
@ -1,4 +1,4 @@
|
|||
{ pkgs, ... }:
|
||||
{ lib, pkgs, ... }:
|
||||
{
|
||||
programs.atuin = {
|
||||
enable = true;
|
||||
|
@ -16,6 +16,12 @@
|
|||
sync_address = "https://atuin.patagia.dev";
|
||||
sync.records = true;
|
||||
|
||||
daemon = {
|
||||
enabled = true;
|
||||
socket_path = "/run/user/1000/atuin.socket"; # FIXME: remove hard coded uid
|
||||
systemd_socket = true;
|
||||
};
|
||||
|
||||
stats.common_subcommands = [
|
||||
"cargo"
|
||||
"git"
|
||||
|
@ -37,4 +43,38 @@
|
|||
];
|
||||
};
|
||||
};
|
||||
|
||||
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" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -15,9 +15,19 @@ in
|
|||
};
|
||||
|
||||
programs.atuin.settings = {
|
||||
show_tabs = false;
|
||||
|
||||
cwd_filter = [
|
||||
"^~/media"
|
||||
"^/home/dln/media"
|
||||
"^/tmp"
|
||||
];
|
||||
|
||||
history_filter = [
|
||||
"^kubectl create secret.*--from-literal"
|
||||
"^kubectl delete ns"
|
||||
"^kubectl delete namespace"
|
||||
"^talosctl reset"
|
||||
];
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue