-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Description
Description
The home-manager module uses hardcoded paths /bin/mkdir and /bin/ln in activation scripts, which don't exist on NixOS. On NixOS, these binaries are located at /run/current-system/sw/bin/.
Environment
- NixOS 24.11 (unstable)
- nix-clawdbot (latest from main branch)
- Deployed via nixos-anywhere to Hetzner Cloud
Error
During home-manager activation (as part of nixos-rebuild switch):
/nix/store/c23s6r3g3xv3gwyg42smqkxydccy0ghq-home-manager-generation/activate: line 276: /bin/mkdir: No such file or directory
Affected Code
In nix/modules/home-manager/clawdbot.nix, the activation scripts use hardcoded paths:
home.activation.clawdbotDirs = lib.hm.dag.entryAfter [ "writeBoundary" ]
'/bin/mkdir -p ...'
home.activation.clawdbotConfigFiles = ...
'/bin/ln -sfn ...'Workaround
Create symlinks manually on the NixOS host before running home-manager:
sudo mkdir -p /bin
sudo ln -sf /run/current-system/sw/bin/mkdir /bin/mkdir
sudo ln -sf /run/current-system/sw/bin/ln /bin/lnSuggested Fix
Replace hardcoded paths with the home-manager $DRY_RUN_CMD convention which handles PATH correctly:
home.activation.clawdbotDirs = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
$DRY_RUN_CMD mkdir -p ...
'';
home.activation.clawdbotConfigFiles = ... ''
$DRY_RUN_CMD ln -sfn ...
'';Alternatively, use explicit nix store paths:
home.activation.clawdbotDirs = lib.hm.dag.entryAfter [ "writeBoundary" ] ''
${pkgs.coreutils}/bin/mkdir -p ...
'';Both approaches are portable across NixOS, macOS, and traditional Linux distributions.
mchowning, n3oney, sgiath, anna-oake, sookochoff and 6 more
Metadata
Metadata
Assignees
Labels
No labels