nixos-rebuild does flakes now, apparently

This commit is contained in:
Charlotte Van Petegem 2020-10-16 13:48:22 +02:00
parent 23b7c3f5a7
commit e0295a239e
No known key found for this signature in database
GPG key ID: 019E764B7184435A
3 changed files with 7 additions and 17 deletions

View file

@ -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[@]}"

View file

@ -1,3 +0,0 @@
#!/usr/bin/env bash
sudo nix shell -vv /nix/var/nix/profiles/system -c switch-to-configuration switch

View file

@ -2,7 +2,7 @@
set -euo pipefail set -euo pipefail
set -x set -x
if [ -d "../nixpkgs" -a -z "${NO_LOCAL:-}" ] if [ -z "${NO_LOCAL:-}" ]
then then
pushd ../nixpkgs pushd ../nixpkgs
git fetch --all --prune git fetch --all --prune
@ -13,4 +13,9 @@ fi
nix flake update --update-input nixpkgs --update-input home-manager --update-input flake-utils 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