fork
Configure Feed
Select the types of activity you want to include in your feed.
nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
fork
Configure Feed
Select the types of activity you want to include in your feed.
1{
2 lib,
3 stdenvNoCC,
4 fetchurl,
5 gzip,
6 xar,
7 cpio,
8 writeShellApplication,
9 curl,
10 cacert,
11 gawk,
12 common-updater-scripts,
13 versionCheckHook,
14 writeShellScript,
15 coreutils,
16 xcbuild,
17}:
18
19stdenvNoCC.mkDerivation (finalAttrs: {
20 pname = "enpass-mac";
21 version = "6.11.8.1861";
22
23 src = fetchurl {
24 url = "https://dl.enpass.io/stable/mac/package/${finalAttrs.version}/Enpass.pkg";
25 hash = "sha256-n0ClsyGTS52ms161CJihIzBI5GjiMIF6HEJ59+jciq8=";
26 };
27
28 dontPatch = true;
29 dontConfigure = true;
30 dontBuild = true;
31 dontFixup = true;
32
33 nativeBuildInputs = [
34 gzip
35 xar
36 cpio
37 ];
38
39 unpackPhase = ''
40 runHook preUnpack
41
42 xar -xf $src
43 gunzip -dc Enpass_temp.pkg/Payload | cpio -i
44
45 runHook postUnpack
46 '';
47
48 installPhase = ''
49 runHook preInstall
50
51 mkdir -p $out/Applications
52 mv Enpass.app $out/Applications
53
54 runHook postInstall
55 '';
56
57 passthru.updateScript = lib.getExe (writeShellApplication {
58 name = "enpass-mac-update-script";
59 runtimeInputs = [
60 curl
61 cacert
62 gawk
63 common-updater-scripts
64 ];
65 text = ''
66 url="https://www.enpass.io/download/macos/website/stable"
67 version=$(curl -Ls -o /dev/null -w "%{url_effective}" "$url" | awk -F'/' '{print $7}')
68 update-source-version enpass-mac "$version"
69 '';
70 });
71
72 nativeInstallCheckInputs = [ versionCheckHook ];
73 versionCheckProgram = writeShellScript "version-check" ''
74 marketing_version=$(${xcbuild}/bin/PlistBuddy -c "Print :CFBundleShortVersionString" "$1" | ${coreutils}/bin/tr -d '"')
75 build_version=$(${xcbuild}/bin/PlistBuddy -c "Print :CFBundleVersion" "$1")
76
77 echo $marketing_version.$build_version
78 '';
79 versionCheckProgramArg = [ "${placeholder "out"}/Applications/Enpass.app/Contents/Info.plist" ];
80 doInstallCheck = true;
81
82 meta = {
83 description = "Choose your own safest place to store passwords";
84 homepage = "https://www.enpass.io";
85 changelog = "https://www.enpass.io/release-notes/macos-website-ver/";
86 license = [ lib.licenses.unfree ];
87 sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
88 maintainers = with lib.maintainers; [ DimitarNestorov ];
89 platforms = lib.platforms.darwin;
90 };
91})