-
Notifications
You must be signed in to change notification settings - Fork 0
/
plugin.nix
52 lines (47 loc) · 900 Bytes
/
plugin.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
{ lib
, glib
, makeWrapper
, rustPlatform
, atk
, gtk3
, gtk-layer-shell
, pkg-config
, librsvg
, inputs
, name
, lockFile
, ...
}:
let
cargoToml = builtins.fromTOML (builtins.readFile ./plugins/${name}/Cargo.toml);
in
rustPlatform.buildRustPackage {
pname = cargoToml.package.name;
version = cargoToml.package.version;
src = "${inputs.self}";
cargoLock = {
inherit lockFile;
};
buildInputs = [
glib
atk
gtk3
librsvg
gtk-layer-shell
];
nativeBuildInputs = [
pkg-config
makeWrapper
];
doCheck = true;
CARGO_BUILD_INCREMENTAL = "false";
RUST_BACKTRACE = "full";
copyLibs = true;
cargoBuildFlags = [ "-p ${name}" ];
buildAndTestSubdir = "plugins/${name}";
meta = with lib; {
description = "The ${name} plugin for Anyrun";
homepage = "https://github.com/wuliuqii/anyrun-plugins";
license = with licenses; [ mit ];
};
}