win-virtio: add updateScript

This commit is contained in:
Anthony Roussel
2023-08-16 22:55:31 +02:00
parent fba74d25f7
commit f445cab1f9
2 changed files with 14 additions and 0 deletions
@@ -24,6 +24,8 @@ stdenv.mkDerivation rec {
runHook postInstall
'';
passthru.updateScript = ./update.sh;
meta = with lib; {
description = "Windows VirtIO Drivers";
homepage = "https://docs.fedoraproject.org/en-US/quick-docs/creating-windows-virtual-machines-using-virtio-drivers/index.html";
@@ -0,0 +1,12 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl pup common-updater-scripts
set -eu -o pipefail
version="$(curl -Ls https://fedorapeople.org/groups/virt/virtio-win/repo/latest/ | \
pup 'a[href*="virtio-win-"] text{}' | \
sed -E 's/virtio-win-(.*)\.noarch\.rpm/\1/' | \
sort -Vu | \
tail -n1)"
update-source-version win-virtio "$version"