-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.nix
30 lines (26 loc) · 918 Bytes
/
package.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
{ lib, rustPlatform, pkg-config, udev }:
let
ignored = lib.fileset.unions [
./flake.lock
(lib.fileset.fileFilter (file: file.hasExt "nix") ./.)
(lib.fileset.fileFilter (file: lib.hasPrefix "." file.name) ./.)
# why is there no way to filter directories based on name in lib.fileset 😔
(lib.fileset.maybeMissing ./.jj)
(lib.fileset.maybeMissing ./.direnv)
];
in rustPlatform.buildRustPackage {
pname = "u2f-touch-detector";
version = "0.1.0";
src = lib.fileset.toSource {
root = ./.;
fileset = lib.fileset.difference ./. ignored;
};
cargoLock.lockFile = ./Cargo.lock;
nativeBuildInputs = [ pkg-config ];
buildInputs = [ udev ];
postInstall = ''
install -Dm444 -t $out/share/systemd/user *.{service,socket}
substituteInPlace $out/share/systemd/user/*.service \
--replace ExecStart=u2f-touch-detector "ExecStart=$out/bin/u2f-touch-detector"
'';
}