diff --git a/pkgs/by-name/ne/netbootxyz-efi/package.nix b/pkgs/by-name/ne/netbootxyz-efi/package.nix index 8da395b55f74..28af5219a34e 100644 --- a/pkgs/by-name/ne/netbootxyz-efi/package.nix +++ b/pkgs/by-name/ne/netbootxyz-efi/package.nix @@ -2,16 +2,32 @@ lib, stdenv, fetchurl, - nix-update-script, }: - +let + version = "2.0.88"; + platformMap = { + aarch64-linux = { + url = "https://github.com/netbootxyz/netboot.xyz/releases/download/${version}/netboot.xyz-arm64.efi"; + hash = "sha256-AeW92FU65XVJKGPi+A/iz7Jvtb7wKIO3xG3Cx7v4kRg="; + }; + x86_64-linux = { + url = "https://github.com/netbootxyz/netboot.xyz/releases/download/${version}/netboot.xyz.efi"; + hash = "sha256-ipbZJ0mPCuwzb/TDtXXUBTuWOcSsKGAJ1GEGIgB2G7E="; + }; + }; +in stdenv.mkDerivation (finalAttrs: { pname = "netboot.xyz-efi"; - version = "2.0.88"; + inherit version; src = fetchurl { - url = "https://github.com/netbootxyz/netboot.xyz/releases/download/${finalAttrs.version}/netboot.xyz.efi"; - hash = "sha256-ipbZJ0mPCuwzb/TDtXXUBTuWOcSsKGAJ1GEGIgB2G7E="; + inherit + (platformMap.${stdenv.hostPlatform.system} + or (throw "Unsupported system: ${stdenv.hostPlatform.system}") + ) + url + hash + ; }; dontUnpack = true; @@ -20,12 +36,14 @@ stdenv.mkDerivation (finalAttrs: { cp $src $out ''; - passthru.updateScript = nix-update-script { }; + passthru.updateScript = ./update.sh; meta = { homepage = "https://netboot.xyz/"; description = "Tool to boot OS installers and utilities over the network, to be run from a bootloader"; license = lib.licenses.asl20; + sourceProvenance = [ lib.sourceTypes.binaryNativeCode ]; + platforms = builtins.attrNames platformMap; maintainers = with lib.maintainers; [ pinpox ]; }; }) diff --git a/pkgs/by-name/ne/netbootxyz-efi/update.sh b/pkgs/by-name/ne/netbootxyz-efi/update.sh new file mode 100755 index 000000000000..9d7dbe4779e5 --- /dev/null +++ b/pkgs/by-name/ne/netbootxyz-efi/update.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env nix-shell +#!nix-shell -i bash -p curl jq nix-update + +set -eou pipefail + +version="$(curl ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} --silent --fail --location "https://api.github.com/repos/netbootxyz/netboot.xyz/releases/latest" | jq --raw-output .tag_name)" + +nix-update --version "$version" --system x86_64-linux netbootxyz-efi +nix-update --version skip --system aarch64-linux netbootxyz-efi