From 7e79a267151dce11a429193ef0d3467abe59254c Mon Sep 17 00:00:00 2001 From: Alexander Tomokhov Date: Tue, 21 Nov 2023 02:52:06 +0400 Subject: [PATCH] do not keep root/.nix-defexpr/channels after reboot --- nixos-infect | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/nixos-infect b/nixos-infect index 097ce7d..a8f8e6d 100755 --- a/nixos-infect +++ b/nixos-infect @@ -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"