14 lines
553 B
Bash
Executable file
14 lines
553 B
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
REV=$(curl https://api.github.com/repos/thexyno/nixos-config/branches/main | jq -r .commit.sha)
|
|
|
|
if [[ $(uname) == "Linux" ]]; then
|
|
sudo nixos-rebuild switch --flake "github:thexyno/nixos-config?rev=$REV"
|
|
else # Darwin
|
|
PRIVATEREV=$(git ls-remote ssh://git@github.com/thexyno/nixos-config-private.git HEAD | awk '{print($1)}')
|
|
darwin-rebuild switch \
|
|
--flake "github:thexyno/nixos-config?rev=$REV" \
|
|
--override-input private "git+ssh://git@github.com/thexyno/nixos-config-private?rev=$PRIVATEREV"
|
|
fi
|