-
-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathpackage.nix
More file actions
103 lines (90 loc) · 2.16 KB
/
package.nix
File metadata and controls
103 lines (90 loc) · 2.16 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
{
lib,
stdenv,
rustPlatform,
fetchFromGitHub,
makeDesktopItem,
pkg-config,
copyDesktopItems,
makeWrapper,
hidapi,
pcsclite,
udev,
alsa-lib,
libxkbcommon,
wayland,
libGL,
vulkan-loader,
libx11,
libxcb,
withGLES ? false,
}:
assert withGLES -> stdenv.hostPlatform.isLinux;
rustPlatform.buildRustPackage (finalAttrs: {
pname = "picoforge";
version = "0.5.0+1";
src = fetchFromGitHub {
owner = "librekeys";
repo = "picoforge";
rev = "v${finalAttrs.version}";
hash = "sha256-onkRH8YeNjqzQU1JNUT45WjSJPm1BIcBjuzWCi7yfrA=";
};
cargoHash = "sha256-zY9YibpzCLkIJ6urImirn+BoGC6BYJzauAIgPlYsdvQ=";
nativeBuildInputs = [
pkg-config
copyDesktopItems
]
++ lib.optionals stdenv.hostPlatform.isLinux [
makeWrapper
];
gpu-lib = if withGLES then libGL else vulkan-loader;
buildInputs = [
hidapi
pcsclite
udev
]
++ lib.optionals stdenv.hostPlatform.isLinux [
alsa-lib
libxkbcommon
wayland
finalAttrs.gpu-lib
libx11
libxcb
];
postInstall = ''
install -Dm644 ${finalAttrs.src}/static/appIcons/in.suyogtandel.picoforge.svg $out/share/icons/hicolor/scalable/apps/picoforge.svg
'';
postFixup = lib.optionalString stdenv.hostPlatform.isLinux ''
wrapProgram $out/bin/picoforge --prefix LD_LIBRARY_PATH : "${
lib.makeLibraryPath [
wayland
libxkbcommon
finalAttrs.gpu-lib
libx11
libxcb
]
}"
'';
desktopItems = [
(makeDesktopItem {
name = "in.suyogtandel.picoforge";
desktopName = "PicoForge";
exec = "picoforge";
terminal = false;
icon = "picoforge";
comment = finalAttrs.meta.description;
categories = [ "Utility" ];
dbusActivatable = true;
keywords = [ "Config" ];
startupNotify = true;
})
];
meta = {
changelog = "https://github.com/librekeys/picoforge/releases/tag/v${finalAttrs.version}";
description = "Open source commissioning tool for Pico FIDO security keys";
homepage = "https://github.com/librekeys/picoforge";
license = lib.licenses.agpl3Only;
mainProgram = "picoforge";
platforms = lib.platforms.linux;
};
})