2024-12-27 21:30:25 -06:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
with lib;
|
|
|
|
let
|
2024-07-16 12:39:48 -05:00
|
|
|
cfg = config.myHome.shell.atuind;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.myHome.shell.atuind = {
|
|
|
|
enable = mkEnableOption "atuind";
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkMerge [
|
|
|
|
(mkIf cfg.enable {
|
2024-12-27 21:30:25 -06:00
|
|
|
systemd.user.services.atuind = {
|
|
|
|
Install = {
|
|
|
|
WantedBy = [ "default.target" ];
|
|
|
|
};
|
|
|
|
Unit = {
|
|
|
|
After = [ "network.target" ];
|
|
|
|
};
|
|
|
|
Service = {
|
|
|
|
Environment = "ATUIN_LOG=info";
|
|
|
|
ExecStart = "${pkgs.unstable.atuin}/bin/atuin daemon";
|
|
|
|
# Remove the socket file if the daemon is not running.
|
|
|
|
# Unexpected shutdowns may have left this file here.
|
|
|
|
ExecStartPre = "/run/current-system/sw/bin/bash -c '! pgrep atuin && /run/current-system/sw/bin/rm -f ~/.local/share/atuin/atuin.sock'";
|
2024-07-16 12:39:48 -05:00
|
|
|
};
|
2024-12-27 21:30:25 -06:00
|
|
|
};
|
2024-07-16 12:39:48 -05:00
|
|
|
})
|
|
|
|
];
|
|
|
|
}
|