do not keep root/.nix-defexpr/channels after reboot

hetzner-flakes
Alexander Tomokhov 2023-11-21 02:52:06 +04:00
parent 5169969e03
commit 7e79a26715
1 changed files with 3 additions and 16 deletions

View File

@ -277,19 +277,7 @@ installNix() {
}
infect() {
# Add nix build users
# FIXME run only if necessary, rather than defaulting true
# groupadd nixbld -g 30000 || true
# for i in {1..10}; do
# useradd -c "Nix build user $i" -d /var/empty -g nixbld -G nixbld -M -N -r -s "$(which nologin)" "nixbld$i" || true
# done
# TODO use addgroup and adduser as fallbacks
#addgroup nixbld -g 30000 || true
#for i in {1..10}; do adduser -DH -G nixbld nixbld$i || true; done
# install Nix in the current system
# (this should create system nixbld users too)
# curl -L "https://releases.nixos.org/nix/nix-$NIX_VERSION/install" | $SHELL
# install multiuser (system-wide with nix-daemon) Nix in the current system
if ! installNix; then
echo "Nix installation failed!"
exit 1
@ -326,9 +314,8 @@ infect() {
# Stage the Nix coup d'état
touch /etc/NIXOS
echo etc/nixos > /etc/NIXOS_LUSTRATE
echo etc/resolv.conf >> /etc/NIXOS_LUSTRATE
echo root/.nix-defexpr/channels >> /etc/NIXOS_LUSTRATE
echo etc/nixos > /etc/NIXOS_LUSTRATE
echo etc/resolv.conf >> /etc/NIXOS_LUSTRATE
rm -rf /boot.bak
((isEFI)) && umount "$ESP"