Hardcoded /bin/mkdir in activation script breaks NixOS deployments #17

Closed
opened 2026-02-15 17:04:30 -05:00 by yindo · 4 comments
Owner

Originally created by @elsbrock on GitHub (Jan 30, 2026).

Description

The Home Manager module hardcodes /bin/mkdir in the activation script, which breaks on NixOS systems where /bin/mkdir does not exist (only /bin/sh is guaranteed on NixOS).

Location

File: nix/modules/home-manager/openclaw.nix

The openclawDirs activation script uses /bin/mkdir -p ... and the openclawConfigFiles script uses /bin/ln -sfn ....

Error

/nix/store/xxx-activate: line 323: /bin/mkdir: No such file or directory

Reproduction

  1. Deploy nix-openclaw on a NixOS system using the Home Manager module
  2. Observe activation failure during home-manager switch

Fix

Replace absolute paths with bare commands (available on PATH during HM activation):

- /bin/mkdir -p ...
+ mkdir -p ...
- /bin/ln -sfn ...
+ ln -sfn ...

Or use explicit Nix store paths like ${pkgs.coreutils}/bin/mkdir.

Workaround

system.activationScripts.binMkdir = ''
  mkdir -p /bin
  ln -sf ${pkgs.coreutils}/bin/mkdir /bin/mkdir
  ln -sf ${pkgs.coreutils}/bin/ln /bin/ln
'';
Originally created by @elsbrock on GitHub (Jan 30, 2026). ## Description The Home Manager module hardcodes `/bin/mkdir` in the activation script, which breaks on NixOS systems where `/bin/mkdir` does not exist (only `/bin/sh` is guaranteed on NixOS). ## Location File: `nix/modules/home-manager/openclaw.nix` The `openclawDirs` activation script uses `/bin/mkdir -p ...` and the `openclawConfigFiles` script uses `/bin/ln -sfn ...`. ## Error ``` /nix/store/xxx-activate: line 323: /bin/mkdir: No such file or directory ``` ## Reproduction 1. Deploy nix-openclaw on a NixOS system using the Home Manager module 2. Observe activation failure during `home-manager switch` ## Fix Replace absolute paths with bare commands (available on PATH during HM activation): ```diff - /bin/mkdir -p ... + mkdir -p ... - /bin/ln -sfn ... + ln -sfn ... ``` Or use explicit Nix store paths like `${pkgs.coreutils}/bin/mkdir`. ## Workaround ```nix system.activationScripts.binMkdir = '' mkdir -p /bin ln -sf ${pkgs.coreutils}/bin/mkdir /bin/mkdir ln -sf ${pkgs.coreutils}/bin/ln /bin/ln ''; ```
yindo closed this issue 2026-02-15 17:04:30 -05:00
Author
Owner

@imrane commented on GitHub (Jan 30, 2026):

I just hit this right now and was coming to post this

@imrane commented on GitHub (Jan 30, 2026): I just hit this right now and was coming to post this
Author
Owner

@sookochoff commented on GitHub (Jan 30, 2026):

This was identified a couple weeks ago. Been hoping for a fix since https://github.com/openclaw/nix-openclaw/issues/5

@sookochoff commented on GitHub (Jan 30, 2026): This was identified a couple weeks ago. Been hoping for a fix since [https://github.com/openclaw/nix-openclaw/issues/5](https://github.com/openclaw/nix-openclaw/issues/5)
Author
Owner

@gudnuf commented on GitHub (Jan 31, 2026):

This seems to be fixed now btw

@gudnuf commented on GitHub (Jan 31, 2026): This seems to be fixed now btw
Author
Owner

@joshp123 commented on GitHub (Feb 3, 2026):

[🤖 this message brought to you by codex] should be fixed in b2721d72 (HM activation uses run + coreutils). Closing for now — come and yell at me in #golden-path-deployments on discord if you're still having issues! Stability work continues; we are making this better every week.

@joshp123 commented on GitHub (Feb 3, 2026): [🤖 this message brought to you by codex] should be fixed in b2721d72 (HM activation uses run + coreutils). Closing for now — come and yell at me in #golden-path-deployments on discord if you're still having issues! Stability work continues; we are making this better every week.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: openclaw/nix-openclaw#17