nixos-config/switch
2025-02-04 23:46:58 -03:00

26 lines
350 B
Bash
Executable file

#!/usr/bin/env bash
set -euo pipefail
nix fmt
git --no-pager diff
run() {
nixos-rebuild \
switch \
--use-remote-sudo \
--print-build-logs \
--flake .# \
"$@"
}
if which nom >/dev/null; then
run --verbose \
--log-format internal-json \
"$@" \
|& nom --json
else
run "$@"
fi