forked from OpenTabletDriver/OpenTabletDriver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
95 lines (79 loc) · 1.89 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
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
{ lib
, buildDotnetModule
, fetchFromGitHub
, fetchurl
, gtk3
, libX11
, libXrandr
, libappindicator
, libevdev
, libnotify
, udev
, copyDesktopItems
, makeDesktopItem
, nixosTests
, wrapGAppsHook
, dpkg
, dotnetCorePackages
, strace
, git
, jq
, coreutils
, gawk
, gnused
, bash
}:
buildDotnetModule rec {
pname = "OpenTabletDriver";
version = "0.7.0.0";
src = ./.;
dotnet-sdk = dotnetCorePackages.sdk_8_0;
dotnet-runtime = dotnetCorePackages.runtime_8_0;
dotnetInstallFlags = [ "--framework=net8.0" ];
projectFile = [ "OpenTabletDriver.Console" "OpenTabletDriver.Daemon" "OpenTabletDriver.UX.Gtk" ];
nugetDeps = ./deps.nix;
executables = [ "OpenTabletDriver.Console" "OpenTabletDriver.Daemon" "OpenTabletDriver.UX.Gtk" ];
nativeBuildInputs = [
copyDesktopItems
wrapGAppsHook
dpkg
jq
coreutils
gawk
gnused
bash
];
runtimeDeps = [
gtk3
libX11
libXrandr
libappindicator
libevdev
libnotify
udev
];
buildInputs = runtimeDeps;
postFixup = ''
# Give a more "*nix" name to the binaries
mv $out/bin/OpenTabletDriver.Console $out/bin/otd
mv $out/bin/OpenTabletDriver.Daemon $out/bin/otd-daemon
mv $out/bin/OpenTabletDriver.UX.Gtk $out/bin/otd-gui
install -Dm644 $src/OpenTabletDriver.UX/Assets/otd.png -t $out/share/pixmaps
# Generate udev rules from source
export OTD_CONFIGURATIONS="$src/OpenTabletDriver.Configurations/Configurations"
mkdir -p $out/lib/udev/rules.d
bash $src/generate-rules.sh \
| sed 's@/usr/bin/env rm@${lib.getExe' coreutils "rm"}@' \
> $out/lib/udev/rules.d/70-opentabletdriver.rules
'';
desktopItems = [
(makeDesktopItem {
desktopName = "OpenTabletDriver";
name = "OpenTabletDriver";
exec = "otd-gui";
icon = "otd";
comment = "Open source, cross-platform, user-mode tablet driver";
categories = [ "Utility" ];
})
];
}