-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackage.nix
45 lines (36 loc) · 848 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
{
rustPlatform,
lib,
targetPlatform,
installShellFiles,
}:
rustPlatform.buildRustPackage {
name = "hover-rs";
src = lib.fileset.toSource {
root = ./.;
fileset = lib.fileset.intersection (lib.fileset.fromSource (lib.sources.cleanSource ./.)) (
lib.fileset.unions [
./src
./Cargo.toml
./Cargo.lock
]
);
};
strictDeps = true;
cargoLock.lockFile = ./Cargo.lock;
env.RUSTFLAGS = lib.optionalString (targetPlatform.libc == "musl") "-C target-feature=+crt-static";
nativeBuildInputs = [
installShellFiles
];
preFixup = ''
mkdir completions
for shell in bash zsh fish; do
$out/bin/hover --completions $shell > completions/hover.$shell
done
installShellCompletion completions/*
'';
doCheck = false;
meta = {
mainProgram = "hover";
};
}