2022-06-01 23:08:03 +02:00
|
|
|
#!/usr/bin/env -S nix shell nixpkgs#gawk nixpkgs#git nixpkgs#moreutils nixpkgs#jq -c bash
|
2022-06-01 00:52:34 +02:00
|
|
|
|
2022-06-01 23:08:03 +02:00
|
|
|
# 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
|
2022-06-01 23:42:05 +02:00
|
|
|
# update nixpkgs to latest version
|
|
|
|
nix flake lock --update-input nixpkgs
|
|
|
|
|
2022-06-01 23:08:03 +02:00
|
|
|
# update wlroots to submodule revision
|
2022-06-16 12:42:31 +02:00
|
|
|
nix flake lock --override-input wlroots "github:ThatOneCalculator/wlroots-mirror/$SUB_REV"
|
2022-06-01 00:52:34 +02:00
|
|
|
|
2022-06-01 23:08:03 +02:00
|
|
|
# remove "dirty" mark from lockfile
|
|
|
|
jq < flake.lock 'del(.nodes.wlroots.original.rev)' | sponge flake.lock
|
|
|
|
else
|
|
|
|
echo "wlroots is up to date!"
|
|
|
|
fi
|