aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/tools/misc/aptly/default.nix
blob: 6af3238dbd771e532534ec6f8b36e8df16a7c162 (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
46
47
{ stdenv, buildGoPackage, fetchFromGitHub, installShellFiles, makeWrapper, gnupg, bzip2, xz, graphviz }:

let

  version = "1.4.0";
  rev = "v${version}";

  aptlySrc = fetchFromGitHub {
    inherit rev;
    owner = "aptly-dev";
    repo = "aptly";
    sha256 = "06cq761r3bxybb9xn58jii0ggp79mcp3810z1r2z3xcvplwhwnhy";
  };

  aptlyCompletionSrc = fetchFromGitHub {
    rev = "1.0.1";
    owner = "aptly-dev";
    repo = "aptly-bash-completion";
    sha256 = "0dkc4z687yk912lpv8rirv0nby7iny1zgdvnhdm5b47qmjr1sm5q";
  };

in

buildGoPackage {
  pname = "aptly";
  inherit version;

  src = aptlySrc;

  goPackagePath = "github.com/aptly-dev/aptly";

  nativeBuildInputs = [ installShellFiles makeWrapper ];

  postInstall = ''
    installShellCompletion --bash ${aptlyCompletionSrc}/aptly
    wrapProgram "$out/bin/aptly" \
      --prefix PATH ":" "${stdenv.lib.makeBinPath [ gnupg bzip2 xz graphviz ]}"
  '';

  meta = with stdenv.lib; {
    homepage = "https://www.aptly.info";
    description = "Debian repository management tool";
    license = licenses.mit;
    platforms = platforms.unix;
    maintainers = [ maintainers.montag451 ];
  };
}