lol
1{
2 lib,
3 fetchFromGitHub,
4 rustPlatform,
5 pkg-config,
6 openssl,
7 stdenv,
8 installShellFiles,
9 libiconv,
10}:
11
12rustPlatform.buildRustPackage rec {
13 pname = "novops";
14 version = "0.20.1";
15
16 src = fetchFromGitHub {
17 owner = "PierreBeucher";
18 repo = "novops";
19 rev = "v${version}";
20 hash = "sha256-F3MtDTaeLoI54/xbbIU61hb+qLDn2u4lRv+3kU5c/D0=";
21 };
22
23 cargoHash = "sha256-F+JIAHk28qpJy97aQQup1Ss5G1p4LQzkj1ptjBhp1CY=";
24
25 buildInputs = [
26 openssl # required for openssl-sys
27 ]
28 ++ lib.optional stdenv.hostPlatform.isDarwin [
29 libiconv
30 ];
31
32 nativeBuildInputs = [
33 installShellFiles
34 pkg-config # required for openssl-sys
35 ];
36
37 cargoTestFlags = [
38 # Only run lib tests (unit tests)
39 # All other tests are integration tests which should not be run with Nix build
40 "--lib"
41 ];
42
43 postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
44 installShellCompletion --cmd novops \
45 --bash <($out/bin/novops completion bash) \
46 --fish <($out/bin/novops completion fish) \
47 --zsh <($out/bin/novops completion zsh)
48 '';
49
50 meta = with lib; {
51 description = "Cross-platform secret & config manager for development and CI environments";
52 homepage = "https://github.com/PierreBeucher/novops";
53 license = licenses.lgpl3;
54 maintainers = with maintainers; [ pbeucher ];
55 mainProgram = "novops";
56 };
57}