Update scripts for flakes
This commit is contained in:
parent
ef64f8bc5d
commit
74573c6eb0
7 changed files with 24 additions and 40 deletions
12
update.sh
12
update.sh
|
@ -2,16 +2,22 @@
|
|||
set -euo pipefail
|
||||
set -x
|
||||
|
||||
./update-imports.sh
|
||||
nix flake update
|
||||
|
||||
BUILD_ARGS=(
|
||||
"--builders"
|
||||
"ssh://charlotte@sunspear.vanpetegem.me"
|
||||
"--builders-use-substitutes"
|
||||
"--extra-substituters"
|
||||
"ssh://charlotte@sunspear.vanpetegem.me"
|
||||
"--trusted-public-keys"
|
||||
"cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= sunspear-nix-cache:4mgL4qS7EweCug1gAFiZKgQK+xuoJMBYThIUE+kPX4s="
|
||||
)
|
||||
result="$(./build.sh "${BUILD_ARGS[@]}" "./machines/$(hostname)")"
|
||||
|
||||
sudo bash -c "nix-env --set --profile /nix/var/nix/profiles/system/ ${result} && ${result}/bin/switch-to-configuration switch"
|
||||
if [ -d "../nixpkgs" ]
|
||||
then
|
||||
BUILD_ARGS+=("--override-input" "nixpkgs" "../nixpkgs")
|
||||
fi
|
||||
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue