chore(lib): add "auto generated" comment to nix generator outputs

fix copy not being able to overwrite generated files due to them being
read only (r--r--r--) by removing them first
This commit is contained in:
technofab 2025-09-02 09:20:58 +02:00
parent 1246175082
commit 3baef660cf
Signed by: technofab
SSH key fingerprint: SHA256:bV4h88OqS/AxjbPn66uUdvK9JsgIW4tv3vwJQ8tpMqQ
2 changed files with 21 additions and 1 deletions

View file

@ -133,6 +133,8 @@ in {
if [[ ! -f "${hook.output}" ]] || ! cmp -s "${hook.generatedDerivation}" "${hook.output}"; then
_soonix_log "info" "${hookName}" "Copying file: ${hook.generatedDerivation} -> ${hook.output}"
mkdir -p "$(dirname "${hook.output}")"
# required since they're read only
rm -f "${hook.output}"
cp "${hook.generatedDerivation}" "${hook.output}"
_changed=true
else