From 34bfaff5d9d87fcb21c8f557e49c90d855763acc Mon Sep 17 00:00:00 2001 From: Charlotte Van Petegem Date: Fri, 26 Feb 2021 10:10:49 +0100 Subject: [PATCH] Build first before needing root privs --- update.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/update.sh b/update.sh index 7f48af70..36dfd491 100755 --- a/update.sh +++ b/update.sh @@ -15,7 +15,9 @@ nix flake update --recreate-lock-file if [ -z "${OVERRIDE:-}" ] then + nix build --no-link --profile /nix/var/nix/profiles/per-user/charlotte/`hostname` .#nixosConfigurations.`hostname`.config.system.build.toplevel su -c "nixos-rebuild --flake . switch" else + nix build --no-link --override-input nixpkgs ../nixpkgs --no-write-lock-file --profile /nix/var/nix/profiles/per-user/charlotte/`hostname` .#nixosConfigurations.`hostname`.config.system.build.toplevel su -c "nixos-rebuild --flake . --override-input nixpkgs ../nixpkgs --no-write-lock-file switch" fi