-
Notifications
You must be signed in to change notification settings - Fork 70
/
package.nix
53 lines (42 loc) · 1.31 KB
/
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
46
47
48
49
50
51
52
53
{ lib
, stdenv
, rustPlatform
, nix-gitignore
, installShellFiles
, nix-eval-jobs
}:
rustPlatform.buildRustPackage rec {
pname = "colmena";
version = "0.5.0-pre";
src = nix-gitignore.gitignoreSource [ ./.srcignore ] ./.;
cargoLock = {
lockFile = ./Cargo.lock;
};
nativeBuildInputs = [ installShellFiles ];
buildInputs = [ nix-eval-jobs ];
NIX_EVAL_JOBS = "${nix-eval-jobs}/bin/nix-eval-jobs";
preBuild = ''
if [[ -z "$NIX_EVAL_JOBS" ]]; then
unset NIX_EVAL_JOBS
fi
'';
postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
installShellCompletion --cmd colmena \
--bash <($out/bin/colmena gen-completions bash) \
--zsh <($out/bin/colmena gen-completions zsh) \
--fish <($out/bin/colmena gen-completions fish)
'';
# Recursive Nix is not stable yet
doCheck = false;
passthru = {
# We guarantee CLI and Nix API stability for the same minor version
apiVersion = builtins.concatStringsSep "." (lib.take 2 (lib.splitString "." version));
};
meta = with lib; {
description = "A simple, stateless NixOS deployment tool";
homepage = "https://colmena.cli.rs/${passthru.apiVersion}";
license = licenses.mit;
maintainers = with maintainers; [ zhaofengli ];
platforms = platforms.linux ++ platforms.darwin;
};
}