git.iko.soy/typeable/nixpkgs
on master help sign in
authy: init at 1.8.3
commit8e372cdfab6546b6d46f2ad4a3ad529d56a65984 authorMrinal Purohit <github@mrinalpurohit.in> dateTue 16 Feb 2021, 18:30 (6 years ago) parentb8878b9
2 files changed+112
pkgs/applications/misc/authy/default.nix+110 pkgs/top-level/all-packages.nix+2
pkgs/applications/misc/authy/default.nixnew file+110
@@ -0,0 +1,110 @@
1+{ alsaLib, at-spi2-atk, at-spi2-core, atk, autoPatchelfHook, cairo, cups
2+, dbus, electron_9, expat, fetchurl, gdk-pixbuf, glib, gtk3, lib
3+, libappindicator-gtk3, libdbusmenu-gtk3, libuuid, makeWrapper
4+, nspr, nss, pango, squashfsTools, stdenv, systemd, xorg
5+}:
6+
7+let
8+ # Currently only works with electron 9
9+ electron = electron_9;
10+in
11+
12+stdenv.mkDerivation rec {
13+ pname = "authy";
14+ version = "1.8.3";
15+ rev = "5";
16+
17+ buildInputs = [
18+ alsaLib
19+ at-spi2-atk
20+ at-spi2-core
21+ atk
22+ cairo
23+ cups
24+ dbus
25+ expat
26+ gdk-pixbuf
27+ glib
28+ gtk3
29+ libappindicator-gtk3
30+ libdbusmenu-gtk3
31+ libuuid
32+ nspr
33+ nss
34+ pango
35+ stdenv.cc.cc
36+ systemd
37+ xorg.libX11
38+ xorg.libXScrnSaver
39+ xorg.libXcomposite
40+ xorg.libXcursor
41+ xorg.libXdamage
42+ xorg.libXext
43+ xorg.libXfixes
44+ xorg.libXi
45+ xorg.libXrandr
46+ xorg.libXrender
47+ xorg.libXtst
48+ xorg.libxcb
49+ ];
50+
51+ src = fetchurl {
52+ url = "https://api.snapcraft.io/api/v1/snaps/download/H8ZpNgIoPyvmkgxOWw5MSzsXK1wRZiHn_${rev}.snap";
53+ sha256 = "1yfvkmy34mc1dan9am11yka88jv7a4dslsszy4kcc8vap4cjmgpn";
54+ };
55+
56+ nativeBuildInputs = [ autoPatchelfHook makeWrapper squashfsTools ];
57+
58+ unpackPhase = ''
59+ runHook preUnpack
60+ unsquashfs "$src"
61+ cd squashfs-root
62+ if ! grep -q '${version}' meta/snap.yaml; then
63+ echo "Package version differs from version found in snap metadata:"
64+ grep 'version: ' meta/snap.yaml
65+ echo "While the nix package specifies: ${version}."
66+ echo "You probably chose the wrong revision or forgot to update the nix version."
67+ exit 1
68+ fi
69+ runHook postUnpack
70+ '';
71+
72+ installPhase = ''
73+ runHook preInstall
74+
75+ mkdir -p $out/lib/
76+
77+ cp -r ./* $out/
78+ rm -R ./*
79+
80+ # The snap package has the `ffmpeg.so` file which is copied over with other .so files
81+ mv $out/*.so $out/lib/
82+
83+ # Replace icon name in Desktop file
84+ sed -i 's|''${SNAP}/meta/gui/icon.png|authy|g' "$out/meta/gui/authy.desktop"
85+
86+ # Move the desktop file, icon, binary to their appropriate locations
87+ mkdir -p $out/bin $out/share/applications $out/share/pixmaps/apps
88+ cp $out/meta/gui/authy.desktop $out/share/applications/
89+ cp $out/meta/gui/icon.png $out/share/pixmaps/authy.png
90+ cp $out/${pname} $out/bin/${pname}
91+
92+ # Cleanup
93+ rm -r $out/{data-dir,gnome-platform,meta,scripts,usr,*.sh,*.so}
94+
95+ runHook postInstall
96+ '';
97+
98+ postFixup = ''
99+ makeWrapper ${electron}/bin/electron $out/bin/${pname} \
100+ --add-flags $out/resources/app.asar
101+ '';
102+
103+ meta = with lib; {
104+ homepage = "https://www.authy.com";
105+ description = "Twilio Authy two factor authentication desktop application";
106+ license = licenses.unfree;
107+ maintainers = with maintainers; [ iammrinal0 ];
108+ platforms = [ "x86_64-linux" ];
109+ };
110+}
pkgs/top-level/all-packages.nix+2
@@ -158,6 +158,8 @@ in
158158
159159 fishnet = callPackage ../servers/fishnet { };
160160
161+ authy = callPackage ../applications/misc/authy { };
162+
161163 avro-tools = callPackage ../development/tools/avro-tools { };
162164
163165 bacnet-stack = callPackage ../tools/networking/bacnet-stack {};