aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMihai Fufezan <[email protected]>2022-06-02 00:08:03 +0300
committerMihai Fufezan <[email protected]>2022-06-02 00:09:28 +0300
commit6daa866beb4d1e26a8b2579a596e669831f7a94f (patch)
tree6559ecfca4c885a6c2d46f2a1743727051c51a4b
parent9447fcd603520a57b2845edd42fdd981303acf18 (diff)
downloadHyprland-6daa866beb4d1e26a8b2579a596e669831f7a94f.tar.gz
Hyprland-6daa866beb4d1e26a8b2579a596e669831f7a94f.zip
nix/updater: only update wlroots on rev change
-rwxr-xr-xnix/update-inputs.sh22
1 files changed, 14 insertions, 8 deletions
diff --git a/nix/update-inputs.sh b/nix/update-inputs.sh
index fd3c248b..d0418d65 100755
--- a/nix/update-inputs.sh
+++ b/nix/update-inputs.sh
@@ -1,13 +1,19 @@
-#!/usr/bin/env -S nix shell nixpkgs#gawk nixpkgs#git nixpkgs#moreutils -c bash
-
-# get wlroots revision from submodule
-rev=$(git submodule status | awk '{ print substr($1,2)}')
+#!/usr/bin/env -S nix shell nixpkgs#gawk nixpkgs#git nixpkgs#moreutils nixpkgs#jq -c bash
# update nixpkgs to latest version
nix flake lock --update-input nixpkgs
-# update wlroots to submodule revision
-nix flake lock --override-input wlroots "gitlab:wlroots/wlroots/$rev?host=gitlab.freedesktop.org"
+# get wlroots revision from submodule
+SUB_REV=$(git submodule status | awk '{ print substr($1,2)}')
+# and from lockfile
+CRT_REV=$(jq < flake.lock '.nodes.wlroots.locked.rev' -r)
+
+if [ $SUB_REV != $CRT_REV ]; then
+ # update wlroots to submodule revision
+ nix flake lock --override-input wlroots "gitlab:wlroots/wlroots/$SUB_REV?host=gitlab.freedesktop.org"
-# remove "dirty" mark from lockfile
-jq < flake.lock 'del(.nodes.wlroots.original.rev)' | sponge flake.lock
+ # remove "dirty" mark from lockfile
+ jq < flake.lock 'del(.nodes.wlroots.original.rev)' | sponge flake.lock
+else
+ echo "wlroots is up to date!"
+fi