c594a97518
GitOrigin-RevId: 301aada7a64812853f2e2634a530ef5d34505048
68 lines
2.5 KiB
Nix
68 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.9.4" else "8.9.6-30.BETA";
|
|
|
|
sources = {
|
|
stable = {
|
|
x86_64-linux = {
|
|
url = "https://downloads.1password.com/linux/tar/stable/x86_64/1password-${version}.x64.tar.gz";
|
|
sha256 = "sha256-Smq0gOGfBTjIOMwF1AI+TJwXaIiTi/YP9mGIqcjsCNQ=";
|
|
};
|
|
aarch64-linux = {
|
|
url = "https://downloads.1password.com/linux/tar/stable/aarch64/1password-${version}.arm64.tar.gz";
|
|
sha256 = "sha256-SJDUfAFEwYnOR+y/6Dg2S/CkA84QogoRpMXOPP5PyrM=";
|
|
};
|
|
x86_64-darwin = {
|
|
url = "https://downloads.1password.com/mac/1Password-${version}-x86_64.zip";
|
|
sha256 = "sha256-+2FQQ5FiB0N30JM/Mtnfa04K2XZaf3r/W1+i8VKNslA=";
|
|
};
|
|
aarch64-darwin = {
|
|
url = "https://downloads.1password.com/mac/1Password-${version}-aarch64.zip";
|
|
sha256 = "sha256-nhocEwtr6cMSSStPa7S+g8SwPStJVWPblA3HbqJ8q6Q=";
|
|
};
|
|
};
|
|
beta = {
|
|
x86_64-linux = {
|
|
url = "https://downloads.1password.com/linux/tar/beta/x86_64/1password-${version}.x64.tar.gz";
|
|
sha256 = "sha256-xBfpBkYff1X26Iu0Ee03lIiR6UdJOiaG+kZMVotG0Hc=";
|
|
};
|
|
aarch64-linux = {
|
|
url = "https://downloads.1password.com/linux/tar/beta/aarch64/1password-${version}.arm64.tar.gz";
|
|
sha256 = "0j0v90i78y1m77gpn65iyjdy1xslv1mar1ihxj9jzcmva0nmdmra";
|
|
};
|
|
x86_64-darwin = {
|
|
url = "https://downloads.1password.com/mac/1Password-${version}-x86_64.zip";
|
|
sha256 = "sha256-PNlEBFoIGYkDR4TzbudsqAE5vjbiVHTNL7XoflN+mUY=";
|
|
};
|
|
aarch64-darwin = {
|
|
url = "https://downloads.1password.com/mac/1Password-${version}-aarch64.zip";
|
|
sha256 = "sha256-PYS0N4VeUjNhCncSDXvpyLuHlpv4nn35aJTPANdMXwk=";
|
|
};
|
|
};
|
|
};
|
|
|
|
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; }
|