Monorepo for Tangled tangled.org

flake/devshell: avoid read-only mode on copied appview static files #1132

merged opened by nolith.dev targeting master from nolith.dev/tangled-core: fix-devshell-cp-perms

The devshell copied assets from the Nix store with preserved mode bits, which left files in appview/pages/static read-only and caused repeated cp permission errors on subsequent nix develop runs.

Stop preserving mode so generated static files remain writable across shell entries.

AI-assisted: OpenCode (openai/gpt-5.3-codex) Signed-off-by: Alessio Caiazza code.git@caiazza.info

Labels

None yet.

assignee

None yet.

Participants 2
AT URI
at://did:plc:nzep3slobztdph3kxswzbing/sh.tangled.repo.pull/3mgoxcmtnqv22
+4 -2
Diff #0
+4 -2
flake.nix
··· 191 191 ]; 192 192 shellHook = '' 193 193 mkdir -p appview/pages/static 194 + # temporary self-heal for workspaces that copied static assets as read-only 195 + [ -d appview/pages/static/icons ] && [ ! -w appview/pages/static/icons ] && chmod -R u+rwX appview/pages/static 194 196 # no preserve is needed because watch-tailwind will want to be able to overwrite 195 - cp -fr --no-preserve=ownership ${packages'.appview-static-files}/* appview/pages/static 197 + cp -fr --no-preserve=ownership,mode ${packages'.appview-static-files}/* appview/pages/static 196 198 export TANGLED_OAUTH_CLIENT_KID="$(date +%s)" 197 199 export TANGLED_OAUTH_CLIENT_SECRET="$(${packages'.goat}/bin/goat key generate -t P-256 | grep -A1 "Secret Key" | tail -n1 | awk '{print $1}')" 198 200 ''; ··· 224 226 program = toString (pkgs.writeShellScript "watch-appview" '' 225 227 echo "copying static files to appview/pages/static..." 226 228 mkdir -p appview/pages/static 227 - ${pkgs.coreutils}/bin/cp -fr --no-preserve=ownership ${packages'.appview-static-files}/* appview/pages/static 229 + ${pkgs.coreutils}/bin/cp -fr --no-preserve=ownership,mode ${packages'.appview-static-files}/* appview/pages/static 228 230 ${air-watcher "appview" ""}/bin/run 229 231 ''); 230 232 };

History

1 round 1 comment
sign up or login to add to the discussion
nolith.dev submitted #0
1 commit
expand
flake/devshell: avoid read-only mode on copied appview static files
expand 1 comment

works like a charm! thanks for this!

pull request successfully merged