Skip to content

Commit

Permalink
atuin: use daemon integration from home-manager
Browse files Browse the repository at this point in the history
Signed-off-by: Patrizio Bekerle <[email protected]>
  • Loading branch information
pbek committed Jan 7, 2025
1 parent 64d2f48 commit c34815f
Showing 1 changed file with 1 addition and 29 deletions.
30 changes: 1 addition & 29 deletions modules/mixins/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@
# https://docs.atuin.sh
atuin = {
enable = true;
daemon.enable = true;
enableFishIntegration = true;
# Writing to the atuin history doesn't work with bash
# See https://github.com/nix-community/home-manager/issues/5958
Expand All @@ -291,39 +292,10 @@
daemon = {
enabled = true;
systemd_socket = true;
socket_path = "/home/${userLogin}/.local/share/atuin/atuin.sock";
};
};
};
};

# Systemd user services for Atuin
# See https://forum.atuin.sh/t/getting-the-daemon-working-on-nixos/334/5
systemd.user =
let
atuinSockDir = "/home/${userLogin}/.local/share/atuin";
atuinSock = "${atuinSockDir}/atuin.sock";
unitConfig = {
Description = "Atuin Magical Shell History Daemon";
ConditionPathIsDirectory = atuinSockDir;
ConditionPathExists = "/home/${userLogin}/.config/atuin/config.toml";
};
in
{
sockets.atuin-daemon = {
Unit = unitConfig;
Install.WantedBy = [ "default.target" ];
Socket = {
ListenStream = atuinSock;
Accept = false;
SocketMode = "0600";
};
};
services.atuin-daemon = {
Unit = unitConfig;
Service.ExecStart = "${pkgs.atuin}/bin/atuin daemon";
};
};
};

# Enable ZRAM swap to get more memory
Expand Down

0 comments on commit c34815f

Please sign in to comment.