From 0050403b31370a82054e8c4522a93036f53d4eaf Mon Sep 17 00:00:00 2001 From: Colin Date: Mon, 3 Jun 2024 05:30:03 +0000 Subject: [PATCH] scripts: add an update helper someday i can extend this for updating packages and feeds too --- scripts/update | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100755 scripts/update diff --git a/scripts/update b/scripts/update new file mode 100755 index 00000000..b535a474 --- /dev/null +++ b/scripts/update @@ -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[@]}"