-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdefault.nix
49 lines (42 loc) · 1.14 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{ pkgs,
lib,
rustPlatform,
llvmPackages
}:
with rustPlatform;
buildRustPackage rec {
pname = "otptray";
version = "0.1.0";
src = builtins.filterSource
(path: type: type != "directory" || baseNameOf path != "target")
./.;
cargoSha256 = "s5W5l+C1cuGTO9nHBkWPe0IfWIKO1+nn+HUp6ua61Wg=";
nativeBuildInputs = [
pkgs.clang
pkgs.pkg-config
];
buildInputs = [
pkgs.libappindicator-gtk3
pkgs.gtk3.dev
llvmPackages.libclang
# pkgs.glib.dev
];
doCheck = false;
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
BINDGEN_EXTRA_CLANG_ARGS = "-isystem ${llvmPackages.libclang.lib}/lib/clang/${lib.getVersion pkgs.clang}/include";
# Update all gnome desktop application binary references
postPatch = ''
substituteInPlace share/applications/otptray.desktop \
--replace /usr $out
'';
installPhase = ''
mkdir -p $out/bin $out/share
cp -rv share $out/
find target/ -name "otptray" -exec cp '{}' $out/bin \;
'';
meta = with lib; {
description = "OTPTray 2FA / OTP helper appindicator tray application";
homepage = "https://blakesmith.me";
license = with licenses; [ mit ];
};
}