scripts: add an update helper
someday i can extend this for updating packages and feeds too
This commit is contained in:
parent
e4bcbab224
commit
0050403b31
35
scripts/update
Executable file
35
scripts/update
Executable file
|
@ -0,0 +1,35 @@
|
|||
#!/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[@]}"
|
Loading…
Reference in New Issue
Block a user