summaryrefslogtreecommitdiffstats
path: root/krebs/5pkgs/get/default.nix
blob: 8a567bbc7d94b175442cacb250abb9e8d8cf080b (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
{ coreutils, gnugrep, gnused, fetchgit, jq, nix, stdenv, ... }:

stdenv.mkDerivation {
  name = "get-1";

  src = fetchgit {
    url = http://cgit.cd.retiolum/get;
    rev = "a39d54aa2e28d8b15a5879024f64f3f41dee9f3b";
    sha256 = "776836e7c5764e547fa46c7d0e14b9a9ccc26c43af288c51096f4073f17b7f32";
  };

  phases = [
    "unpackPhase"
    "installPhase"
  ];

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

      sed \
        '1s,.*,&\nPATH=${path},' \
        < ./get \
        > $out/bin/get

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