From f16e31d5fd7be7c9a67b9f16153273769372e43a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christopher=20Fred=C3=A9n?= Date: Sat, 4 Apr 2020 17:31:50 +0200 Subject: [PATCH] Don't move /boot it might be a mounted partition --- lib/infect | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/infect b/lib/infect index efcd44f..a713676 100644 --- a/lib/infect +++ b/lib/infect @@ -20,8 +20,12 @@ infect() { echo etc/resolv.conf >> /etc/NIXOS_LUSTRATE echo root/.nix-defexpr/channels >> /etc/NIXOS_LUSTRATE - rm -rf /boot.bak - mv -v /boot /boot.bak + if mount | grep -q "on /boot "; then + cp -vr /boot /boot.bak + umount /boot + else + mv -v /boot /boot.bak + fi /nix/var/nix/profiles/system/bin/switch-to-configuration boot }