diff --git a/pkgs/servers/mir/common.nix b/pkgs/servers/mir/common.nix index 0f0ec736f8fe..5643188690f0 100644 --- a/pkgs/servers/mir/common.nix +++ b/pkgs/servers/mir/common.nix @@ -2,7 +2,10 @@ stdenv, rustPlatform, lib, + common-updater-scripts, fetchFromGitHub, + genericUpdater, + gitUpdater, nixosTests, testers, cargo, @@ -245,7 +248,29 @@ stdenv.mkDerivation ( "mir-shell" ]; } - // lib.optionalAttrs (!pinned) { updateScript = ./update.sh; }; + // lib.optionalAttrs (!pinned) { + updateScript = + let + cusWithFlag = common-updater-scripts.overrideAttrs (oa: { + # Have to double-wrap it... + installPhase = oa.installPhase + '' + wrapProgram $out/bin/update-source-version \ + --add-flag '--file=${lib.strings.removeSuffix "/common.nix" __curPos.file}/default.nix' + ''; + }); + in + # Attrs to update are in default.nix + (gitUpdater.override { + common-updater-scripts = cusWithFlag; + genericUpdater = genericUpdater.override { + common-updater-scripts = cusWithFlag; + }; + }) + { + rev-prefix = "v"; + ignoredVersions = "-(dev|rc)$"; + }; + }; meta = { description = "Display server and Wayland compositor developed by Canonical"; diff --git a/pkgs/servers/mir/update.sh b/pkgs/servers/mir/update.sh deleted file mode 100755 index c018c6db7d2a..000000000000 --- a/pkgs/servers/mir/update.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env nix-shell -#!nix-shell -i bash -p curl gnused jq common-updater-scripts - -set -eou pipefail - -version="$(curl --silent "https://api.github.com/repos/canonical/mir/tags" | jq '.[0].name' --raw-output)" - -update-source-version mir "${version:1}" --file=./pkgs/servers/mir/default.nix