mochi/nixos/home/modules/shell/atuind/default.nix
Joseph Hanson 2b6d062d16
All checks were successful
Build / nix-build (native-x86_64, telperion) (push) Successful in 2m13s
Build / nix-build (native-x86_64, gandalf) (push) Successful in 3m23s
Build / nix-build (native-x86_64, shadowfax) (push) Successful in 4m38s
reformat
2024-12-27 21:30:25 -06:00

35 lines
830 B
Nix

{
config,
pkgs,
lib,
...
}:
with lib;
let
cfg = config.myHome.shell.atuind;
in
{
options.myHome.shell.atuind = {
enable = mkEnableOption "atuind";
};
config = mkMerge [
(mkIf cfg.enable {
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'";
};
};
})
];
}