my atuin config for nixOS

· sillybit

#nix #terminal #linux

_ Make your shell magical _

That's the promise and it does certainly look and feel pretty neat compared to good ol' recursive shell history.

Get it here. https://atuin.sh/

# Issues configuring atuin on nixOS

After some trial and error I came up with a atuin nix config I could import into my main config and get working. It doesn't handle the sign or options but it gets the service running and the adds the eval statement for my global bash config.

Although it's been a while since I figured it out, I think this was needed because whenever I started a new shell, I had to manually run the eval command or add it to my ~/.bashrc and then source it which defeated the purpose. Since I'm not using home-manager, I had to run eval in this interactiveShellInit block ¯_(ツ)_/¯

# The config

{ config, pkgs, ... }:

{
  # Install atuin package to system and add to path.
  environment.systemPackages = with pkgs; [ atuin ];

  services.atuin = {
    enable = true;
  };

  programs.bash = {
    interactiveShellInit = ''
      eval "$(atuin init bash)"
    '';
  };
}

# Stats

These stats are all just from this one install and machine.

[todd@nixos:~/Documents/obsyncdian]$ atuin stats
[▮▮▮▮▮▮▮▮▮▮] 47 ls
[▮▮▮▮▮▮▮▮▮ ] 43 git status
[▮▮▮▮▮▮▮▮  ] 39 nvim
[▮▮▮▮▮▮▮   ] 35 git log
[▮▮▮▮▮▮    ] 30 git commit
[▮▮▮▮      ] 23 z
[▮▮▮▮      ] 23 git diff
[▮▮▮▮      ] 22 nixos-rebuild
[▮▮▮▮      ] 19 nix-shell
[▮▮▮▮      ] 19 cd
Total commands:   491
Unique commands:  169