From e0295a239e8cc57ad177e5586f8870b363c97344 Mon Sep 17 00:00:00 2001 From: Charlotte Van Petegem Date: Fri, 16 Oct 2020 13:48:22 +0200 Subject: [PATCH] nixos-rebuild does flakes now, apparently --- build.sh | 12 ------------ switch.sh | 3 --- update.sh | 9 +++++++-- 3 files changed, 7 insertions(+), 17 deletions(-) delete mode 100755 build.sh delete mode 100755 switch.sh diff --git a/build.sh b/build.sh deleted file mode 100755 index ff7565d4..00000000 --- a/build.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail -set -x - -BUILD_ARGS=() - -if [ -d "../nixpkgs" -a -z "${NO_LOCAL:-}" ] -then - BUILD_ARGS+=("--override-input" "nixpkgs" "../nixpkgs" "--no-write-lock-file") -fi - -sudo nix build --profile /nix/var/nix/profiles/system ".#nixosConfigurations.$(hostname).config.system.build.toplevel" --no-link "${BUILD_ARGS[@]}" diff --git a/switch.sh b/switch.sh deleted file mode 100755 index 73725946..00000000 --- a/switch.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env bash - -sudo nix shell -vv /nix/var/nix/profiles/system -c switch-to-configuration switch diff --git a/update.sh b/update.sh index ea398f48..b48a5836 100755 --- a/update.sh +++ b/update.sh @@ -2,7 +2,7 @@ set -euo pipefail set -x -if [ -d "../nixpkgs" -a -z "${NO_LOCAL:-}" ] +if [ -z "${NO_LOCAL:-}" ] then pushd ../nixpkgs git fetch --all --prune @@ -13,4 +13,9 @@ fi nix flake update --update-input nixpkgs --update-input home-manager --update-input flake-utils -./build.sh && ./switch.sh +if [ -z "${OVERRIDE:-}" ] +then + sudo nixos-rebuild --flake . switch +else + sudo nixos-rebuild --flake . --override-input nixpkgs ../nixpkgs --no-write-lock-file switch +fi