diff --git a/nix/update-inputs.sh b/nix/update-inputs.sh index eb4b7dd79..c34e40f6f 100755 --- a/nix/update-inputs.sh +++ b/nix/update-inputs.sh @@ -1,16 +1,25 @@ #!/usr/bin/env -S nix shell nixpkgs#jq -c bash -# Update inputs when the Mesa version is outdated. We don't want +# Update inputs when the Mesa or QT version is outdated. We don't want # incompatibilities between the user's system and Hyprland. # get the current Nixpkgs revision REV=$(jq $NEW_VER and flake inputs" +get_ver() { + nix eval --raw "github:nixos/nixpkgs/$1#$2" +} + +# check versions for current and remote nixpkgs' +MESA_OLD=$(get_ver "$REV" mesa.version) +MESA_NEW=$(get_ver nixos-unstable mesa.version) +QT_OLD=$(get_ver "$REV" kdePackages.qtbase.version) +QT_NEW=$(get_ver nixos-unstable kdePackages.qtbase.version) + +if [ "$MESA_OLD" != "$MESA_NEW" ] || [ "$QT_OLD" != "$QT_NEW" ]; then + echo "Updating flake inputs..." + echo "Mesa: $MESA_OLD -> $MESA_NEW" + echo "Qt: $QT_OLD -> $QT_NEW" # update inputs to latest versions nix flake update