mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-14 12:48:57 +00:00
orion-browser: init at 149
This commit is contained in:
52
pkgs/by-name/or/orion-browser/package.nix
Normal file
52
pkgs/by-name/or/orion-browser/package.nix
Normal 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 ];
|
||||
};
|
||||
})
|
||||
28
pkgs/by-name/or/orion-browser/update.sh
Executable file
28
pkgs/by-name/or/orion-browser/update.sh
Executable 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"
|
||||
Reference in New Issue
Block a user