summaryrefslogtreecommitdiffstats
path: root/krebs/5pkgs/cac/default.nix
blob: 5e48cce742928a129045c25ec70f22429266eba3 (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
{ stdenv, fetchgit, coreutils, curl, gnused, inotifyTools, jq, ncurses, sshpass, ... }:

stdenv.mkDerivation {
  name = "cac-1.0.2";

  src = fetchgit {
    url = http://cgit.cd.retiolum/cac;
    rev = "3d6aef3631aa2e0becba447ed9c36a268dcf8bb5";
    sha256 = "4f584ef8d53a003818ec6608d2cccda42fc7806cd6f9fa9ad179346f3f59744c";
  };

  phases = [
    "unpackPhase"
    "installPhase"
  ];

  installPhase =
    let
      path = stdenv.lib.makeSearchPath "bin" [
        coreutils
        curl
        gnused
        inotifyTools
        jq
        ncurses
        sshpass
      ];
    in
    ''
      mkdir -p $out/bin

      sed 's;^_main .*;PATH=${path} &;' < ./cac > $out/bin/cac

      chmod +x $out/bin/cac
    '';
}