···11+---
22+layout: ../../layouts/PostLayout.astro
33+title: Nix package manager in fly.io Sprites
44+published: 2026-02-22
55+modified: 2026-02-22
66+---
77+88+Recently I stumbled upon [Fly.io](https://fly.io/)'s [Sprites](https://sprites.dev/).
99+1010+[Tangled](https://tangled.org/) uses [`nix`](https://nixos.org/download) (the package manager)
1111+and since I had my development setup for Tangled in a docker container(TODO: add footnote) it was a good excuse to play around with them.
1212+1313+## How to install
1414+1515+First, choose the multi-user installation:
1616+1717+`sh <(curl --proto '=https' --tlsv1.2 -L https://nixos.org/nix/install) --daemon`
1818+1919+> **Note**: The installer will complain, that you don't have `systemd` installed. This is expected—we will handle that next.
2020+2121+Next, add the `nix` daemon to the services of your Sprite:
2222+2323+`sprite-env services create nix-daemon --cmd sudo --args /nix/var/nix/profiles/default/bin/nix-daemon`
2424+2525+That's all. Yep.
2626+2727+## Errors I encountered
2828+2929+### `nix develop` hangs on `copying [something] to the store`
3030+3131+This was really annoying, because the Sprite would just crash after a few minutes stuck at this step.
3232+3333+The issue ended up being that the user is not trusted (in the `nix` context).
3434+3535+To fix it:
3636+3737+- Add `trusted-users = root sprite` to `/etc/nix/nix.conf`
3838+- Restart the nix daemon (using `sprite-env`)
3939+4040+### `nix store info` hangs at `Store URL: daemon`
4141+4242+The issue here is most likely, that the daemon is not running as root.
4343+4444+You can verify this with `ls -la /nix/var/nix/daemon-socket/socket`. The owner should be `root` (not `sprite`).
4545+4646+To fix this, make sure you started the daemon with `sudo`.