Hyprland/nix/update-wlroots.sh

18 lines
564 B
Bash
Raw Permalink Normal View History

2023-07-19 18:18:13 +02:00
#!/usr/bin/env -S nix shell nixpkgs#gawk nixpkgs#git nixpkgs#gnused nixpkgs#ripgrep -c bash
# get wlroots revision from submodule
2023-07-19 18:18:13 +02:00
SUB_REV=$(git submodule status | rg wlroots | awk '{ print substr($1,2) }')
# and from lockfile
2023-07-19 18:18:13 +02:00
CRT_REV=$(rg rev flake.nix | awk '{ print substr($3, 2, 40) }')
if [ "$SUB_REV" != "$CRT_REV" ]; then
echo "Updating wlroots..."
# update wlroots to submodule revision
2023-07-19 18:18:13 +02:00
sed -Ei "s/\w{40}/$SUB_REV/g" flake.nix subprojects/wlroots.wrap
nix flake lock
2023-07-19 18:18:13 +02:00
echo "wlroots: $CRT_REV -> $SUB_REV"
else
echo "wlroots is up to date!"
fi