2024-07-27 06:49:29 +00:00
|
|
|
{
|
|
|
|
stdenv,
|
|
|
|
callPackage,
|
|
|
|
channel ? "stable",
|
|
|
|
fetchurl,
|
|
|
|
lib,
|
|
|
|
# This is only relevant for Linux, so we need to pass it through
|
|
|
|
polkitPolicyOwners ? [ ],
|
|
|
|
}:
|
2022-03-30 09:31:56 +00:00
|
|
|
|
|
|
|
let
|
2020-08-20 17:08:02 +00:00
|
|
|
pname = "1password";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = if channel == "stable" then "8.10.36" else "8.10.38-13.BETA";
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
sources = {
|
|
|
|
stable = {
|
|
|
|
x86_64-linux = {
|
2022-08-21 13:32:41 +00:00
|
|
|
url = "https://downloads.1password.com/linux/tar/stable/x86_64/1password-${version}.x64.tar.gz";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-yUSU0np6li5zLfFOnebpv0+s1UQ6BdgI+28OvcxS3H8=";
|
2022-08-21 13:32:41 +00:00
|
|
|
};
|
2022-10-21 18:38:19 +00:00
|
|
|
aarch64-linux = {
|
|
|
|
url = "https://downloads.1password.com/linux/tar/stable/aarch64/1password-${version}.arm64.tar.gz";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-KG0PJ/gwBd9+qYyraRqS/D58Y58VwLd8yCnYzPVWQAY=";
|
2022-10-21 18:38:19 +00:00
|
|
|
};
|
|
|
|
x86_64-darwin = {
|
|
|
|
url = "https://downloads.1password.com/mac/1Password-${version}-x86_64.zip";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-vYhmA9N1izPRo3HPDouOpjJzMwK7LkCHuyYxBGkIPKM=";
|
2022-10-21 18:38:19 +00:00
|
|
|
};
|
|
|
|
aarch64-darwin = {
|
|
|
|
url = "https://downloads.1password.com/mac/1Password-${version}-aarch64.zip";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-v1eCh/cOpA5XcmamAqreKHRQ+waoBQtvvmNO4wvFq6A=";
|
2022-10-21 18:38:19 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
beta = {
|
|
|
|
x86_64-linux = {
|
|
|
|
url = "https://downloads.1password.com/linux/tar/beta/x86_64/1password-${version}.x64.tar.gz";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-SeB1Em2WuYvslBv//TROYTAB1asYFhC22IwhcwGi+Qs=";
|
2022-10-21 18:38:19 +00:00
|
|
|
};
|
|
|
|
aarch64-linux = {
|
|
|
|
url = "https://downloads.1password.com/linux/tar/beta/aarch64/1password-${version}.arm64.tar.gz";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-Ik5gL5FCxNANOKx/MSH7dCz3XEdLr7jxykaWhMQKUVw=";
|
2022-10-21 18:38:19 +00:00
|
|
|
};
|
|
|
|
x86_64-darwin = {
|
|
|
|
url = "https://downloads.1password.com/mac/1Password-${version}-x86_64.zip";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-8cNxhRAOrn/A++APOMUxwrD3+a++ksRMzlmmnQ8J8/c=";
|
2022-10-21 18:38:19 +00:00
|
|
|
};
|
|
|
|
aarch64-darwin = {
|
|
|
|
url = "https://downloads.1password.com/mac/1Password-${version}-aarch64.zip";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-YkZbuCFvWHksLQYKJ3LQD2YDXj9qwHF4Gg8JbxBZsuc=";
|
2022-10-21 18:38:19 +00:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
src = fetchurl {
|
2024-07-27 06:49:29 +00:00
|
|
|
inherit
|
|
|
|
(sources.${channel}.${stdenv.system} or (throw "unsupported system ${stdenv.hostPlatform.system}"))
|
|
|
|
url
|
|
|
|
hash
|
|
|
|
;
|
2022-10-21 18:38:19 +00:00
|
|
|
};
|
2022-09-30 11:47:45 +00:00
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
meta = {
|
|
|
|
# Requires to be installed in "/Application" which is not possible for now (https://github.com/NixOS/nixpkgs/issues/254944)
|
|
|
|
broken = stdenv.isDarwin;
|
2020-08-20 17:08:02 +00:00
|
|
|
description = "Multi-platform password manager";
|
|
|
|
homepage = "https://1password.com/";
|
2024-07-27 06:49:29 +00:00
|
|
|
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
|
|
|
|
license = lib.licenses.unfree;
|
|
|
|
maintainers = with lib.maintainers; [
|
|
|
|
timstott
|
|
|
|
savannidgerinel
|
|
|
|
sebtm
|
|
|
|
];
|
2022-10-21 18:38:19 +00:00
|
|
|
platforms = builtins.attrNames sources.${channel};
|
2023-08-04 22:07:22 +00:00
|
|
|
mainProgram = "1password";
|
2020-08-20 17:08:02 +00:00
|
|
|
};
|
2022-10-21 18:38:19 +00:00
|
|
|
|
2024-07-27 06:49:29 +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
|
|
|
|
;
|
|
|
|
}
|