forked from helsinki-systems/harmonia
-
-
Notifications
You must be signed in to change notification settings - Fork 20
/
default.nix
52 lines (49 loc) · 1.25 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
{
pkgs ?
(builtins.getFlake (builtins.toString ./.)).inputs.nixpkgs.legacyPackages.${builtins.currentSystem},
rustPlatform ? pkgs.rustPlatform,
nix-gitignore ? pkgs.nix-gitignore,
lib ? pkgs.lib,
clippy ? pkgs.clippy,
pkg-config ? pkgs.pkg-config,
libsodium ? pkgs.libsodium,
openssl ? pkgs.openssl,
enableClippy ? false,
}:
rustPlatform.buildRustPackage (
{
name = "harmonia";
src = nix-gitignore.gitignoreSource [ ] (
lib.sources.sourceFilesBySuffices (lib.cleanSource ./.) [
".rs"
".toml"
".lock"
".cpp"
".h"
".md"
]
);
cargoLock.lockFile = ./Cargo.lock;
nativeBuildInputs = [ pkg-config ] ++ lib.optionals enableClippy [ clippy ];
buildInputs = [
libsodium
openssl
];
doCheck = false;
meta = with lib; {
description = "Nix binary cache implemented in rust";
homepage = "https://github.com/nix-community/harmonia";
license = with licenses; [ mit ];
maintainers = [ maintainers.conni2461 ];
platforms = platforms.all;
};
}
// lib.optionalAttrs enableClippy {
buildPhase = ''
cargo clippy --all-targets --all-features -- -D warnings
'';
installPhase = ''
touch $out
'';
}
)