orion-browser: init at 149

This commit is contained in:
Pradyuman Vig
2026-07-12 21:55:12 -05:00
parent 95e7ef5ed7
commit bb01c8c8fd
2 changed files with 80 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
{
lib,
stdenvNoCC,
fetchurl,
makeWrapper,
unzip,
}:
stdenvNoCC.mkDerivation (finalAttrs: {
pname = "orion-browser";
version = "149";
src = fetchurl {
url = "https://cdn.kagi.com/updates/26_0/${finalAttrs.version}.zip";
hash = "sha256-C0mtGNE9Or0alFe2Gu4LkRcHMvk1RLXZ/mUo/XtWB2g=";
};
strictDeps = true;
__structuredAttrs = true;
unpackCmd = "unzip -q $curSrc -x '__MACOSX/*'";
nativeBuildInputs = [
makeWrapper
unzip
];
sourceRoot = ".";
installPhase = ''
runHook preInstall
mkdir -p "$out/Applications" "$out/bin"
cp -R Orion.app "$out/Applications"
makeWrapper "$out/Applications/Orion.app/Contents/MacOS/Orion" "$out/bin/orion"
runHook postInstall
'';
passthru.updateScript = ./update.sh;
meta = {
description = "WebKit-based web browser by Kagi";
homepage = "https://orionbrowser.com/";
changelog = "https://orionbrowser.com/updates/orion-release-notes";
license = lib.licenses.unfree;
mainProgram = "orion";
maintainers = with lib.maintainers; [ pradyuman ];
platforms = [ "aarch64-darwin" ];
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
};
})

View File

@@ -0,0 +1,28 @@
#!/usr/bin/env nix
#!nix shell -f ``<nixpkgs>`` curl jq libplist _7zz common-updater-scripts -c bash
set -euo pipefail
macos_version="26_0"
tmpdir="$(mktemp -d)"
trap 'rm -rf "$tmpdir"' EXIT
dmg="$tmpdir/Orion.dmg"
curl -fsSL -o "$dmg" "https://cdn.kagi.com/downloads/$macos_version/Orion.dmg"
version="$(
7zz e -so "$dmg" "Orion/Orion.app/Contents/Info.plist" \
| plistutil -i - -f json -o - \
| jq -r '.CFBundleVersion'
)"
if [[ -z "$version" ]]; then
echo "[update] Failed to read Orion version from Info.plist" >&2
exit 1
fi
zip="$tmpdir/Orion.zip"
curl -fsSL -o "$zip" "https://cdn.kagi.com/updates/$macos_version/$version.zip"
hash="$(nix hash file --type sha256 --sri "$zip")"
update-source-version orion-browser "$version" "$hash"