2c76a4cb41
GitOrigin-RevId: c757e9bd77b16ca2e03c89bf8bc9ecb28e0c06ad
69 lines
2.5 KiB
Nix
69 lines
2.5 KiB
Nix
{ stdenv
|
|
, callPackage
|
|
, channel ? "stable"
|
|
, fetchurl
|
|
, lib
|
|
# This is only relevant for Linux, so we need to pass it through
|
|
, polkitPolicyOwners ? [ ] }:
|
|
|
|
let
|
|
|
|
pname = "1password";
|
|
version = if channel == "stable" then "8.10.18" else "8.10.20-1.BETA";
|
|
|
|
sources = {
|
|
stable = {
|
|
x86_64-linux = {
|
|
url = "https://downloads.1password.com/linux/tar/stable/x86_64/1password-${version}.x64.tar.gz";
|
|
hash = "sha256-3oK8Jzz4+TY4IW8oAenzHo7KQeP58iZ+on5PNliBn7I=";
|
|
};
|
|
aarch64-linux = {
|
|
url = "https://downloads.1password.com/linux/tar/stable/aarch64/1password-${version}.arm64.tar.gz";
|
|
hash = "sha256-OsmgHPlAt9K7ytXMM8BANGcKcD3U1OLd2MLfOS4lc6Q=";
|
|
};
|
|
x86_64-darwin = {
|
|
url = "https://downloads.1password.com/mac/1Password-${version}-x86_64.zip";
|
|
hash = "sha256-wozym2QOLLUf4F+MwdIZfwN+VHkNewB+ZJZEkVNnb/c=";
|
|
};
|
|
aarch64-darwin = {
|
|
url = "https://downloads.1password.com/mac/1Password-${version}-aarch64.zip";
|
|
hash = "sha256-v1FZIsvFyIx81BORgDtZBP9jTRY6/0p537trOGf8mcM=";
|
|
};
|
|
};
|
|
beta = {
|
|
x86_64-linux = {
|
|
url = "https://downloads.1password.com/linux/tar/beta/x86_64/1password-${version}.x64.tar.gz";
|
|
hash = "sha256-+wHxtlE0zeVEObzdpcIP75LKbbjsG8LMqdIPFkY0BoU=";
|
|
};
|
|
aarch64-linux = {
|
|
url = "https://downloads.1password.com/linux/tar/beta/aarch64/1password-${version}.arm64.tar.gz";
|
|
hash = "sha256-BRsp/hhBwgQFU+5Tt1M9V5Lx8oRLN3uaqLrzrPo/xpo=";
|
|
};
|
|
x86_64-darwin = {
|
|
url = "https://downloads.1password.com/mac/1Password-${version}-x86_64.zip";
|
|
hash = "sha256-WVP5a007cU1GR/lnL7C6QiJpTTsjzaiS69H2LJzYm70=";
|
|
};
|
|
aarch64-darwin = {
|
|
url = "https://downloads.1password.com/mac/1Password-${version}-aarch64.zip";
|
|
hash = "sha256-BBSUSSnot1ktC0ik7yMhqsgLdkeQBrJUpHBvwu0w9m0=";
|
|
};
|
|
};
|
|
};
|
|
|
|
src = fetchurl {
|
|
inherit (sources.${channel}.${stdenv.system}) url hash;
|
|
};
|
|
|
|
meta = with lib; {
|
|
description = "Multi-platform password manager";
|
|
homepage = "https://1password.com/";
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
|
license = licenses.unfree;
|
|
maintainers = with maintainers; [ timstott savannidgerinel amaxine sebtm ];
|
|
platforms = builtins.attrNames sources.${channel};
|
|
mainProgram = "1password";
|
|
};
|
|
|
|
in if stdenv.isDarwin
|
|
then callPackage ./darwin.nix { inherit pname version src meta; }
|
|
else callPackage ./linux.nix { inherit pname version src meta polkitPolicyOwners; }
|