Split off build.sh from update.sh
This commit is contained in:
parent
397c0e222f
commit
35e9ce3c5f
2 changed files with 14 additions and 5 deletions
13
build.sh
Executable file
13
build.sh
Executable file
|
@ -0,0 +1,13 @@
|
|||
#!/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[@]}" && \
|
||||
sudo nix shell -vv /nix/var/nix/profiles/system -c switch-to-configuration switch
|
|
@ -2,11 +2,8 @@
|
|||
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")
|
||||
pushd ../nixpkgs
|
||||
git fetch --all --prune
|
||||
git rebase upstream/nixos-unstable-small || exit 1
|
||||
|
@ -16,5 +13,4 @@ fi
|
|||
|
||||
nix flake update --update-input nixpkgs --update-input home-manager --update-input flake-utils
|
||||
|
||||
sudo nix build --profile /nix/var/nix/profiles/system ".#nixosConfigurations.$(hostname).config.system.build.toplevel" --no-link "${BUILD_ARGS[@]}" && \
|
||||
sudo nix --experimental-features "nix-command flakes" shell -vv /nix/var/nix/profiles/system -c switch-to-configuration switch
|
||||
./build.sh
|
||||
|
|
Loading…
Add table
Reference in a new issue