mochi/nixos/home/modules/shell/atuind/default.nix

34 lines
826 B
Nix
Raw Normal View History

2024-12-27 21:30:25 -06:00
{
config,
pkgs,
lib,
...
}:
2025-03-06 09:51:33 -06:00
with lib; let
cfg = config.myHome.shell.atuind;
2025-03-06 09:51:33 -06:00
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 = {
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-12-27 21:30:25 -06:00
};
})
];
}