summaryrefslogtreecommitdiffstats
path: root/krebs/5pkgs/test/infest-cac-centos7/default.nix
blob: c3fc0ee2be8dcd2c50446772265e4cec271142d9 (plain)
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
{ lib, makeWrapper, stdenv
, cac-api, cac-cert, cac-panel, coreutils, gnumake, gnused, jq, openssh, proot, sshpass
}:

stdenv.mkDerivation rec {
  name = "${shortname}-${version}";
  shortname = "infest-cac-centos7";
  version = "0.2.7";

  src = ./notes;

  phases = [
    "installPhase"
  ];

  buildInputs = [ makeWrapper ];

  path = lib.makeSearchPath "bin" [
    coreutils
    cac-api
    cac-panel
    gnumake
    gnused
    jq
    openssh
    sshpass
    proot
  ];

  installPhase = ''
    mkdir -p $out/bin
    cp ${src} $out/bin/${shortname}
    chmod +x $out/bin/${shortname}
    wrapProgram $out/bin/${shortname} \
        --prefix PATH : ${path} \
        --set REQUESTS_CA_BUNDLE ${cac-cert} \
        --set SSL_CERT_FILE ${cac-cert}
  '';
  meta = with lib; {
    homepage = http://krebsco.de;
    description = "infest a CaC box with stockholm";
    license = licenses.wtfpl;
    maintainers = [ maintainers.makefu ];
  };
}