nix-configs/packages/scripts/nosrebuild
2022-04-12 01:31:27 +02:00

11 lines
374 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:ragon000/nixos-config?rev=$REV"
else # Darwin
/nix/var/nix/profiles/system/sw/bin/darwin-rebuild switch --flake "github:ragon000/nixos-config?rev=$REV"
fi