flake.nix: make sure git dubitious permission error vanishes with docker image using /root .gitconfig considering all dirs as safe dir

Signed-off-by: Thierry Laurion <insurgo@riseup.net>
This commit is contained in:
Thierry Laurion 2024-11-03 09:10:54 -05:00
parent 515ca5db95
commit 61ac2d9960
No known key found for this signature in database
GPG Key ID: 9A53E1BB3FF00461

View File

@ -139,15 +139,17 @@
-e ACLOCAL_PATH \ -e ACLOCAL_PATH \
${self.devShell.${system}} >/devenv.sh ${self.devShell.${system}} >/devenv.sh
# Git configuration for safe directory access.
printf '[safe]\n\tdirectory = *\n' >/.gitconfig
mkdir /tmp; # Temporary directory for various operations. mkdir /tmp; # Temporary directory for various operations.
chmod 1777 /tmp
# Ensure /etc/passwd and /etc/group exist with root entries # Ensure /etc/passwd and /etc/group exist with root entries
echo "root:x:0:0:root:/root:/bin/bash" > /etc/passwd echo "root:x:0:0:root:/root:/bin/bash" > /etc/passwd
echo "root:x:0:" > /etc/group echo "root:x:0:" > /etc/group
mkdir -p /root mkdir -p /root
chmod 700 /root chmod 700 /root
# Git configuration for safe directory access.
echo -e '[safe]\n\tdirectory = *\n' > /root/.gitconfig
''; '';
}; };
}); });