-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathdefault.nix
More file actions
68 lines (62 loc) · 1.39 KB
/
default.nix
File metadata and controls
68 lines (62 loc) · 1.39 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
{
rustPlatform,
lib,
clippy,
self,
pkgsStatic,
scdoc,
installShellFiles,
withClippy ? false,
}:
let
package = rustPlatform.buildRustPackage {
name = "cntr";
src = lib.sources.sourceFilesBySuffices self [
".rs"
".toml"
".lock"
".scd"
".bash"
".zsh"
".fish"
".nu"
];
cargoLock.lockFile = ./Cargo.lock;
nativeBuildInputs = [
clippy
scdoc
installShellFiles
];
# Provide statically-linked shell for integration tests
CNTR_TEST_SHELL = "${pkgsStatic.busybox}/bin/sh";
postInstall = ''
# Build and install manpage
scdoc < doc/cntr.1.scd > cntr.1
installManPage cntr.1
# Install shell completions
installShellCompletion --cmd cntr \
--bash completions/cntr.bash \
--zsh completions/cntr.zsh \
--fish completions/cntr.fish \
--nushell completions/cntr.nu
'';
meta = with lib; {
description = "A container debugging tool based on Linux mount API";
homepage = "https://github.com/Mic92/cntr";
license = licenses.mit;
maintainers = with maintainers; [ mic92 ];
platforms = platforms.unix;
};
};
in
if withClippy then
package.overrideAttrs (oldAttrs: {
buildPhase = ''
cargo clippy --release --locked -- -D warnings
'';
installPhase = ''
touch $out
'';
})
else
package