nixos-rebuild does flakes now, apparently
This commit is contained in:
parent
23b7c3f5a7
commit
e0295a239e
3 changed files with 7 additions and 17 deletions
12
build.sh
12
build.sh
|
@ -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[@]}"
|
|
@ -1,3 +0,0 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
sudo nix shell -vv /nix/var/nix/profiles/system -c switch-to-configuration switch
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue