Skip to content

fix(nix): Set brig-containerd's PATH before its first command - #39

Open
jjacke13 wants to merge 1 commit into
NOFireAI:mainfrom
jjacke13:nix-containerd-path
Open

jjacke13 wants to merge 1 commit into
NOFireAI:mainfrom
jjacke13:nix-containerd-path

Conversation

@jjacke13

@jjacke13 jjacke13 commented Nov 11, 2026 •

Copy link
Copy Markdown

Hi! We met at FOSSCOMM 2026 in Athens, where you mentioned the Nix packages are experimental. I have been running the flake on a NixOS laptop since, and this is the first and smallest thing I found.

brig-containerd runs mkdir, chmod and install before it exports its PATH, and that PATH has no coreutils. Under services.brig systemd gives the unit a PATH, so it works. Anywhere else, for example the unit started with systemd-run on NixOS, whose default PATH has no coreutils, it stops before containerd starts:

brig-containerd: line 4: mkdir: command not found

Changes

  • nix/runtime.nix: export PATH is the first command of brig-containerd, and daemonPath has coreutils.

Tested

NixOS 26.05, x86_64, at edbf7a1.

The built brig-containerd, as a normal user with an empty PATH (env -i PATH=/var/empty sh …/bin/brig-containerd):

main:         line 4: mkdir: command not found
this branch:  chmod: changing permissions of '/run/brig': Operation not permitted

so it gets past mkdir and stops only on root's work.

As root on a fresh NixOS VM with the module's own unit stopped, each build's brig-containerd under systemd-run --collect -p Type=notify -p Delegate=yes -p KillMode=process:

main:         line 4: mkdir: command not found      (unit failed)
this branch:  unit active; brig run -d ubuntu rc=0; brig sh ubuntu answers

nix build .#checks.x86_64-linux.module passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant