mirror of
https://github.com/openclaw/nix-openclaw.git
synced 2026-07-24 21:25:23 -04:00
Bug: Hardcoded /bin/mkdir and /bin/ln paths fail on NixOS #1
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @rhnvrm on GitHub (Jan 19, 2026).
Description
The home-manager module uses hardcoded paths
/bin/mkdirand/bin/lnin activation scripts, which don't exist on NixOS. On NixOS, these binaries are located at/run/current-system/sw/bin/.Environment
Error
During
home-manageractivation (as part ofnixos-rebuild switch):Affected Code
In
nix/modules/home-manager/clawdbot.nix, the activation scripts use hardcoded paths:Workaround
Create symlinks manually on the NixOS host before running home-manager:
Suggested Fix
Replace hardcoded paths with the home-manager
$DRY_RUN_CMDconvention which handles PATH correctly:Alternatively, use explicit nix store paths:
Both approaches are portable across NixOS, macOS, and traditional Linux distributions.
@zenware commented on GitHub (Jan 27, 2026):
The correct way to solve this problem per home-manager: https://nix-community.github.io/home-manager/options.xhtml#opt-home.activation
Is to prefix commands with
runin a home-manager activation context. Which also has the benefit of respecting env vars likeDRY_RUN=1or flags like--verboseI've been trying to build a check that runs on
nix flake checkor which runs in the CI that can clearly show as a pair of two commits, that the issue exists in the activation stage, and that a change torun mkdirsolves it... But for some reason it's been really tricky to get the activation scripts to trigger unless actually building and running (e.g.home-manager switch)🤞 hoping the project maintainer can find a weekend to review some of these PRs
@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.