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.6" else "8.10.7-11.BETA";
|
|
|
|
sources = {
|
|
stable = {
|
|
x86_64-linux = {
|
|
url = "https://downloads.1password.com/linux/tar/stable/x86_64/1password-${version}.x64.tar.gz";
|
|
sha256 = "sha256-wCY94x67z+X8l3wr79+BXuu6/UXJldbVIA67AAD9mj0=";
|
|
};
|
|
aarch64-linux = {
|
|
url = "https://downloads.1password.com/linux/tar/stable/aarch64/1password-${version}.arm64.tar.gz";
|
|
sha256 = "sha256-iLjuudWmkLMuoZSZZo9pRpx0MZludUrGTpTHCTNk4Vo=";
|
|
};
|
|
x86_64-darwin = {
|
|
url = "https://downloads.1password.com/mac/1Password-${version}-x86_64.zip";
|
|
sha256 = "sha256-FVj5x1RVBxPsgWhG6R4ykarZdLdJcj6gO5mQy3hHB4M=";
|
|
};
|
|
aarch64-darwin = {
|
|
url = "https://downloads.1password.com/mac/1Password-${version}-aarch64.zip";
|
|
sha256 = "sha256-ilQP1OF4gydzlLZq3aZzqNbzvacRbruzWS7pVt6DP9g=";
|
|
};
|
|
};
|
|
beta = {
|
|
x86_64-linux = {
|
|
url = "https://downloads.1password.com/linux/tar/beta/x86_64/1password-${version}.x64.tar.gz";
|
|
sha256 = "sha256-O7dzNRukIk654FoS1HxqHYcB8mLNORvz59p3skRXuYM=";
|
|
};
|
|
aarch64-linux = {
|
|
url = "https://downloads.1password.com/linux/tar/beta/aarch64/1password-${version}.arm64.tar.gz";
|
|
sha256 = "sha256-npEVlGwMmYXH4wW6VvAhPzWNFOZl1LvuCnOgvm94rds=";
|
|
};
|
|
x86_64-darwin = {
|
|
url = "https://downloads.1password.com/mac/1Password-${version}-x86_64.zip";
|
|
sha256 = "sha256-Z0IZNEU8ggSF20SZziT5UTEMiWPNdVWY82nhuGyeFVU=";
|
|
};
|
|
aarch64-darwin = {
|
|
url = "https://downloads.1password.com/mac/1Password-${version}-aarch64.zip";
|
|
sha256 = "sha256-qy1Vr6nDJo44Qd7mKZYR65+tIaSq0YOjjw84/mg1RgE=";
|
|
};
|
|
};
|
|
};
|
|
|
|
src = fetchurl {
|
|
inherit (sources.${channel}.${stdenv.system}) url sha256;
|
|
};
|
|
|
|
meta = with lib; {
|
|
description = "Multi-platform password manager";
|
|
homepage = "https://1password.com/";
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
|
license = licenses.unfree;
|
|
maintainers = with maintainers; [ timstott savannidgerinel maxeaubrey sebtm ];
|
|
platforms = builtins.attrNames sources.${channel};
|
|
};
|
|
|
|
in if stdenv.isDarwin
|
|
then callPackage ./darwin.nix { inherit pname version src meta; }
|
|
else callPackage ./linux.nix { inherit pname version src meta polkitPolicyOwners; }
|