2022-10-08 05:39:06 +00:00
|
|
|
{ stdenv
|
|
|
|
, callPackage
|
|
|
|
, channel ? "stable"
|
2020-08-08 07:06:45 +00:00
|
|
|
, fetchurl
|
2022-10-08 05:39:06 +00:00
|
|
|
, lib
|
|
|
|
# This is only relevant for Linux, so we need to pass it through
|
|
|
|
, polkitPolicyOwners ? [ ] }:
|
2022-03-16 18:09:37 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
|
2020-08-08 07:06:45 +00:00
|
|
|
pname = "1password";
|
2024-07-23 12:50:05 +00:00
|
|
|
version = if channel == "stable" then "8.10.36" else "8.10.34-10.BETA";
|
2020-08-08 07:06:45 +00:00
|
|
|
|
2022-10-08 05:39:06 +00:00
|
|
|
sources = {
|
|
|
|
stable = {
|
|
|
|
x86_64-linux = {
|
2022-08-12 21:46:13 +00:00
|
|
|
url = "https://downloads.1password.com/linux/tar/stable/x86_64/1password-${version}.x64.tar.gz";
|
2024-07-23 12:50:05 +00:00
|
|
|
hash = "sha256-yUSU0np6li5zLfFOnebpv0+s1UQ6BdgI+28OvcxS3H8=";
|
2022-08-12 21:46:13 +00:00
|
|
|
};
|
2022-10-08 05:39:06 +00:00
|
|
|
aarch64-linux = {
|
|
|
|
url = "https://downloads.1password.com/linux/tar/stable/aarch64/1password-${version}.arm64.tar.gz";
|
2024-07-23 12:50:05 +00:00
|
|
|
hash = "sha256-KG0PJ/gwBd9+qYyraRqS/D58Y58VwLd8yCnYzPVWQAY=";
|
2022-10-08 05:39:06 +00:00
|
|
|
};
|
|
|
|
x86_64-darwin = {
|
|
|
|
url = "https://downloads.1password.com/mac/1Password-${version}-x86_64.zip";
|
2024-07-23 12:50:05 +00:00
|
|
|
hash = "sha256-vYhmA9N1izPRo3HPDouOpjJzMwK7LkCHuyYxBGkIPKM=";
|
2022-10-08 05:39:06 +00:00
|
|
|
};
|
|
|
|
aarch64-darwin = {
|
|
|
|
url = "https://downloads.1password.com/mac/1Password-${version}-aarch64.zip";
|
2024-07-23 12:50:05 +00:00
|
|
|
hash = "sha256-v1eCh/cOpA5XcmamAqreKHRQ+waoBQtvvmNO4wvFq6A=";
|
2022-10-08 05:39:06 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
beta = {
|
|
|
|
x86_64-linux = {
|
|
|
|
url = "https://downloads.1password.com/linux/tar/beta/x86_64/1password-${version}.x64.tar.gz";
|
2024-05-21 21:29:10 +00:00
|
|
|
hash = "sha256-eX7D8D5KErFIQtyvg4oT+lR3A7sfRFpDMT7duigZTz0=";
|
2022-10-08 05:39:06 +00:00
|
|
|
};
|
|
|
|
aarch64-linux = {
|
|
|
|
url = "https://downloads.1password.com/linux/tar/beta/aarch64/1password-${version}.arm64.tar.gz";
|
2024-05-21 21:29:10 +00:00
|
|
|
hash = "sha256-dajdeU8TtD9Dbnp2MFedAl8tuQr275cUqGAnm/VF+OE=";
|
2022-10-08 05:39:06 +00:00
|
|
|
};
|
|
|
|
x86_64-darwin = {
|
|
|
|
url = "https://downloads.1password.com/mac/1Password-${version}-x86_64.zip";
|
2024-05-21 21:29:10 +00:00
|
|
|
hash = "sha256-Dm8v7B8qDSBe1i7OJKQFn7YDPkw3Qj8YVtQkaQmdKuc=";
|
2022-10-08 05:39:06 +00:00
|
|
|
};
|
|
|
|
aarch64-darwin = {
|
|
|
|
url = "https://downloads.1password.com/mac/1Password-${version}-aarch64.zip";
|
2024-05-21 21:29:10 +00:00
|
|
|
hash = "sha256-QSxJoVPlOQU7hbvbuVcB/kf5umRjJQuygMkXq6lE1CQ=";
|
2022-10-08 05:39:06 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2020-08-08 07:06:45 +00:00
|
|
|
|
2022-10-08 05:39:06 +00:00
|
|
|
src = fetchurl {
|
2024-04-05 02:30:31 +00:00
|
|
|
inherit (sources.${channel}.${stdenv.system} or (throw "unsupported system ${stdenv.hostPlatform.system}")) url hash;
|
2022-10-08 05:39:06 +00:00
|
|
|
};
|
2022-09-22 03:45:36 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-08-08 07:06:45 +00:00
|
|
|
description = "Multi-platform password manager";
|
|
|
|
homepage = "https://1password.com/";
|
2022-06-04 22:19:25 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2020-08-08 07:06:45 +00:00
|
|
|
license = licenses.unfree;
|
2024-04-27 08:49:31 +00:00
|
|
|
maintainers = with maintainers; [ timstott savannidgerinel sebtm ];
|
2022-10-08 05:39:06 +00:00
|
|
|
platforms = builtins.attrNames sources.${channel};
|
2023-08-04 19:10:05 +00:00
|
|
|
mainProgram = "1password";
|
2020-08-08 07:06:45 +00:00
|
|
|
};
|
2022-10-08 05:39:06 +00:00
|
|
|
|
|
|
|
in if stdenv.isDarwin
|
|
|
|
then callPackage ./darwin.nix { inherit pname version src meta; }
|
|
|
|
else callPackage ./linux.nix { inherit pname version src meta polkitPolicyOwners; }
|