the home site for me: also iteration 3 or 4 of my site

feat: add atuin post

dunkirk.sh cd514009 769e1f3a

verified
Changed files
+97
content
+97
content/blog/2025-04-24_atuin.md
···
+
+++
+
title = "Musings about Atuin"
+
date = 2025-04-24
+
slug = "atuin"
+
description = "its a bit tricky on nix, but it's sooo worth it"
+
+
[taxonomies]
+
tags = ["shell", "nix", "cool stuff"]
+
+++
+
+
I've been on the fence about using [Atuin](https://atuin.sh) for about a month now. I heard about it from [Ellie](https://ellie.wtf) on bluesky and initially didn't bother setting it up since I didn't really care about whether my shell history was synced across devices as I'm only using one main device (framework 13 🔥) rn. I saw a repost of Ellie's about Atuin Desktop today and that finally pushed me over the edge to take the time to figure out how to get it setup with nix.
+
+
<!-- more -->
+
+
{{ bluesky(post="https://bsky.app/profile/ellie.wtf/post/3lng5ig2o722z") }}
+
+
And it wasn't that hard! Atuin is published on nixpkgs or can be installed via a flake and there is a home manager module for it too! Once you get past actual installation and into using agenix to declaritively manage your secrets then it gets annoying (proly mainly because i'm still pretty stupid when it comes to nix lol).
+
+
The first bit is that to access age secrets in home manager you have to actually export them in home manager (🤯) and you can't just use the version from your `configuration.nix`. The second bit is that you **also** need to export the age file in your `configuration.nix` (that took me a solid half hour to figure out :uw_embarrassed:). The third and final thing however is that you can't just save the secret and key files with agenix like normal but you have to strip the line endings from them 😭.
+
+
Here's the basic scaffolding you'll need for your Nix configuration:
+
+
> configuration.nix
+
```nix
+
{ config, pkgs, ... }:
+
+
{
+
# ... configuration options
+
+
age.secrets = {
+
atuin-session = {
+
file = ../secrets/atuin-session.age;
+
mode = "0444";
+
};
+
atuin-key = {
+
file = ../secrets/atuin-key.age;
+
mode = "0444";
+
};
+
};
+
+
# ... more configuration options
+
}
+
```
+
+
and then the home-manager bit
+
+
> shell.nix in home manager
+
```nix
+
{ config, pkgs, ... }:
+
+
{
+
# ... some home-manager modules and configs
+
+
programs.atuin = {
+
enable = true;
+
settings = {
+
auto_sync = true;
+
sync_frequency = "5m";
+
sync_address = "https://api.atuin.sh";
+
search_mode = "fuzzy";
+
session_path = config.age.secrets."atuin-session".path;
+
key_path = config.age.secrets."atuin-key".path;
+
};
+
};
+
+
age.secrets = {
+
atuin-session = {
+
file = ../../secrets/atuin-session.age;
+
};
+
atuin-key = {
+
file = ../../secrets/atuin-key.age;
+
};
+
};
+
+
# ... even more home-manager configurations 😅
+
}
+
```
+
+
Now saving the secrets with agenix is not particularly tricky you just have to know that this is an option. Run `agenix -e atuin-session.age` and then paste in the session from `~/.local/share/atuin/session` and then instead of just saving like normal you need to run `:set binary` and then `:set noeol` and then you can save the file like normal.
+
+
Anyways now i'm enjoying my stats and it's on to the next project (proly [serif.blue](https://tangled.sh/@dunkirk.sh/serif) 👀)
+
+
```
+
> atuin stats
+
[▮▮▮▮▮▮▮▮▮▮] 1209 gc
+
[▮▮▮▮ ] 495 curl
+
[▮▮ ] 348 bun
+
[▮▮ ] 329 cat
+
[▮ ] 222 z
+
[▮ ] 200 g
+
[▮ ] 162 nix-shell
+
[▮ ] 145 cd
+
[▮ ] 138 vi
+
[▮ ] 138 ls
+
Total commands: 7062
+
Unique commands: 7060
+
```