2024-12-27 21:30:25 -06:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
2025-03-06 09:51:33 -06:00
|
|
|
with lib; let
|
2024-07-16 12:39:48 -05:00
|
|
|
cfg = config.myHome.shell.atuind;
|
2025-03-06 09:51:33 -06:00
|
|
|
in {
|
2024-07-16 12:39:48 -05:00
|
|
|
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 = {
|
2025-03-06 09:51:33 -06:00
|
|
|
WantedBy = ["default.target"];
|
2024-12-27 21:30:25 -06:00
|
|
|
};
|
|
|
|
Unit = {
|
2025-03-06 09:51:33 -06:00
|
|
|
After = ["network.target"];
|
2024-12-27 21:30:25 -06:00
|
|
|
};
|
|
|
|
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
|
|
|
})
|
|
|
|
];
|
|
|
|
}
|