nix-files/scripts/update
Colin 0050403b31 scripts: add an update helper
someday i can extend this for updating packages and feeds too
2024-06-03 05:30:03 +00:00

36 lines
592 B
Bash
Executable File

#!/bin/sh
inputs=()
addInputs() {
case $1 in
(safe)
inputs+=(uninsane-dot-org nixpkgs-unpatched nixpkgs-next-unpatched sops-nix)
;;
(unsafe)
# these tend to break more frequently
inputs+=(mobile-nixos nixpkgs-wayland)
;;
(*)
echo "unknown input '$1'"
exit 1
;;
esac
}
case "$1" in
(all|"")
addInputs "safe"
addInputs "unsafe"
;;
(*)
addInputs "$1"
;;
esac
echo "updating:" "${inputs[@]}"
nixFlags=()
for i in "${inputs[@]}"; do
nixFlags+=("--update-input" "$i")
done
nix flake lock "${nixFlags[@]}"