Commit 50342eea authored by Bert Proesmans's avatar Bert Proesmans
Browse files

netbootxyz-efi: Add aarch64 blob and updater script

parent 944f4655
Loading
Loading
Loading
Loading
+24 −6
Original line number Diff line number Diff line
@@ -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 ];
  };
})
+9 −0
Original line number Diff line number Diff line
#!/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