nix-dotfiles/home/programs/atuin.nix

67 lines
1.6 KiB
Nix
Raw Permalink Normal View History

2023-05-08 01:48:38 +02:00
{ config, ... }:
2024-06-26 20:18:28 +02:00
let
cfg = config.programs.atuin;
# TODO: retrieve this in a more dynamic and correct manner
xdg_runtime_dir = "/run/user/1000";
in
2023-05-08 01:48:38 +02:00
{
programs.atuin = {
enable = true;
enableBashIntegration = true;
enableZshIntegration = true;
settings = {
db_path = "${config.xdg.dataHome}/atuin/history.db";
key_path = "${config.xdg.configHome}/atuin/key";
session_path = "${config.xdg.configHome}/atuin/session_key";
dialect = "uk";
search_mode = "fuzzy";
style = "auto";
inline_height = 13;
2023-07-12 01:37:46 +02:00
sync_address = "https://atuin.nani.wtf";
sync_frequency = "1h";
auto_sync = true;
update_check = true;
2024-06-26 20:18:28 +02:00
daemon = {
enabled = true;
socket_path = "${xdg_runtime_dir}/atuin.socket";
# systemd = true;
};
};
};
# TODO: fix socket activation
# systemd.user.sockets.atuin-daemon = {
# Unit.Description = "Socket activation for atuin shell history daemon";
# Socket = {
# ListenStream = "%t/atuin.socket";
# SocketMode = "0600";
# RemoveOnStop = true;
# };
# Install.WantedBy = [ "sockets.target" ];
# };
systemd.user.services.atuin-daemon = {
Unit = {
Description = "Atuin shell history daemon";
# Requires = "atuin-daemon.socket";
};
Service = {
ExecStart = "${cfg.package}/bin/atuin daemon";
# Environment = [
# "ATUIN_DAEMON__SYSTEMD_SOCKET=true"
# ];
};
Install = {
# Also = [ "atuin-daemon.socket" ];
WantedBy = [ "default.target" ];
2023-05-08 01:48:38 +02:00
};
};
}