biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / applications / misc / 1password-gui / default.nix
blobcecb229ce13f2f0c6e85f299b674bd88c6d19a2c
2   stdenv,
3   callPackage,
4   channel ? "stable",
5   fetchurl,
6   lib,
7   # This is only relevant for Linux, so we need to pass it through
8   polkitPolicyOwners ? [ ],
9 }:
11 let
12   pname = "1password";
13   version = if channel == "stable" then "8.10.40" else "8.10.44-21.BETA";
15   sources = {
16     stable = {
17       x86_64-linux = {
18         url = "https://downloads.1password.com/linux/tar/stable/x86_64/1password-${version}.x64.tar.gz";
19         hash = "sha256-viY0SOUhrOvmue6Nolau356rIqwDo2nLzMilFFmNb9g=";
20       };
21       aarch64-linux = {
22         url = "https://downloads.1password.com/linux/tar/stable/aarch64/1password-${version}.arm64.tar.gz";
23         hash = "sha256-7lUZiS3TSsIVqPoN5A6YqyVaaaRI9BliT51FHkwOPyw=";
24       };
25       x86_64-darwin = {
26         url = "https://downloads.1password.com/mac/1Password-${version}-x86_64.zip";
27         hash = "sha256-xK/B8J3VP8y1xw3KorzZzPf/LjYmYdOIjDECMJnVv6I=";
28       };
29       aarch64-darwin = {
30         url = "https://downloads.1password.com/mac/1Password-${version}-aarch64.zip";
31         hash = "sha256-iqdK6K7dcypZFGseYal2KjOaqJtUjXeCzbDdx7pDv8A=";
32       };
33     };
34     beta = {
35       x86_64-linux = {
36         url = "https://downloads.1password.com/linux/tar/beta/x86_64/1password-${version}.x64.tar.gz";
37         hash = "sha256-enorJfbn+xJVy1fG3wjhO3LkSsMncHA9/yA13kG+h4Y=";
38       };
39       aarch64-linux = {
40         url = "https://downloads.1password.com/linux/tar/beta/aarch64/1password-${version}.arm64.tar.gz";
41         hash = "sha256-EUnIIi6DB5kBVid9ExBpNApKItHnRKQziBy/GFt0xag=";
42       };
43       x86_64-darwin = {
44         url = "https://downloads.1password.com/mac/1Password-${version}-x86_64.zip";
45         hash = "sha256-U14CjoUJUpd4wWidZz6xGErhHI/VPChqG8cwBTBYoYc=";
46       };
47       aarch64-darwin = {
48         url = "https://downloads.1password.com/mac/1Password-${version}-aarch64.zip";
49         hash = "sha256-DD1M2EFSHqG9OHX5Q/CmZLZIKYrBMS4cnX/6tLVi7H0=";
50       };
51     };
52   };
54   src = fetchurl {
55     inherit
56       (sources.${channel}.${stdenv.system} or (throw "unsupported system ${stdenv.hostPlatform.system}"))
57       url
58       hash
59       ;
60   };
62   meta = {
63     # Requires to be installed in "/Application" which is not possible for now (https://github.com/NixOS/nixpkgs/issues/254944)
64     broken = stdenv.hostPlatform.isDarwin;
65     description = "Multi-platform password manager";
66     homepage = "https://1password.com/";
67     sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
68     license = lib.licenses.unfree;
69     maintainers = with lib.maintainers; [
70       timstott
71       savannidgerinel
72       sebtm
73     ];
74     platforms = builtins.attrNames sources.${channel};
75     mainProgram = "1password";
76   };
79 if stdenv.hostPlatform.isDarwin then
80   callPackage ./darwin.nix {
81     inherit
82       pname
83       version
84       src
85       meta
86       ;
87   }
88 else
89   callPackage ./linux.nix {
90     inherit
91       pname
92       version
93       src
94       meta
95       polkitPolicyOwners
96       ;
97   }