From 4cf9f98105283cb6a3b252c1fab3a6cd63e0d1f7 Mon Sep 17 00:00:00 2001 From: Alexander Tomokhov Date: Wed, 22 Nov 2023 01:49:05 +0400 Subject: [PATCH] remove installed Nix after switch-to-configuration boot --- nixos-infect | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nixos-infect b/nixos-infect index cc41a03..a5c2a89 100755 --- a/nixos-infect +++ b/nixos-infect @@ -296,10 +296,6 @@ infect() { exit 1 fi - # Remove nix installed by the "install" script. - rm -fv /nix/var/nix/profiles/default* - /nix/var/nix/profiles/system/sw/bin/nix-collect-garbage - # Reify resolv.conf (???) [[ -L /etc/resolv.conf ]] && mv -v /etc/resolv.conf /etc/resolv.conf.lnk && cat /etc/resolv.conf.lnk > /etc/resolv.conf @@ -322,6 +318,10 @@ infect() { if ! /nix/var/nix/profiles/system/bin/switch-to-configuration boot; then echo "Failed!"; exit 1 fi + + # Remove nix installed by the "install" script. + rm -fv /nix/var/nix/profiles/default* + /nix/var/nix/profiles/system/sw/bin/nix-collect-garbage } set -o pipefail