{ 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.46" else "8.10.48-17.BETA"; sources = { stable = { x86_64-linux = { url = "https://downloads.1password.com/linux/tar/stable/x86_64/1password-${version}.x64.tar.gz"; hash = "sha256-oewS90rSBqxA0V+ttcmUXznUZ3+mb5FKtmYD4kUDmTk="; }; aarch64-linux = { url = "https://downloads.1password.com/linux/tar/stable/aarch64/1password-${version}.arm64.tar.gz"; hash = "sha256-tHQIhLPTD2dFRK542kFnpExg36paaNuzyOED8ZKyIYk="; }; x86_64-darwin = { url = "https://downloads.1password.com/mac/1Password-${version}-x86_64.zip"; hash = "sha256-pnAE1UTMXX89wshEI/wzhySb1NZY5ke5bSYmUjvU/pc="; }; aarch64-darwin = { url = "https://downloads.1password.com/mac/1Password-${version}-aarch64.zip"; hash = "sha256-MmHUa96keBV9+E2GQdgz/aCTXeFkVNqHV0eH8/WhvhY="; }; }; beta = { x86_64-linux = { url = "https://downloads.1password.com/linux/tar/beta/x86_64/1password-${version}.x64.tar.gz"; hash = "sha256-4SPZJP/ebnyAMEWrIGonb+5nYXuM8KCPK9modC/Cr/Y="; }; aarch64-linux = { url = "https://downloads.1password.com/linux/tar/beta/aarch64/1password-${version}.arm64.tar.gz"; hash = "sha256-V5Nt81Trw6l7DAUtCX2Yv/fL2wBJpJER0iaOBmMfQ5o="; }; x86_64-darwin = { url = "https://downloads.1password.com/mac/1Password-${version}-x86_64.zip"; hash = "sha256-UfSUPqZgbYdWyrfw41SdnnI1IeA+dYsfBAu/UQl0vVI="; }; aarch64-darwin = { url = "https://downloads.1password.com/mac/1Password-${version}-aarch64.zip"; hash = "sha256-ynkDnJtoKMAtegeilB0XIH+YrSS9EKYV1ceN0Ecls+A="; }; }; }; src = fetchurl { inherit (sources.${channel}.${stdenv.system} or (throw "unsupported system ${stdenv.hostPlatform.system}")) url hash ; }; meta = { # Requires to be installed in "/Application" which is not possible for now (https://github.com/NixOS/nixpkgs/issues/254944) broken = stdenv.hostPlatform.isDarwin; description = "Multi-platform password manager"; homepage = "https://1password.com/"; sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; license = lib.licenses.unfree; maintainers = with lib.maintainers; [ timstott savannidgerinel sebtm ]; platforms = builtins.attrNames sources.${channel}; mainProgram = "1password"; }; in if stdenv.hostPlatform.isDarwin then callPackage ./darwin.nix { inherit pname version src meta ; } else callPackage ./linux.nix { inherit pname version src meta polkitPolicyOwners ; }