summary refs log tree commit diff
path: root/pkgs/applications/version-management/git-and-tools/git-crypt/default.nix
blob: 487f9b9625f491d67a20c265ba5dcf989ef2d868 (plain) (blame)
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
48
49
50
51
52
53
54
55
{ fetchFromGitHub, git, gnupg, makeWrapper, openssl, stdenv
, libxslt, docbook_xsl
}:

stdenv.mkDerivation rec {
  pname = "git-crypt";
  version = "0.6.0";

  src = fetchFromGitHub {
    owner = "AGWA";
    repo = pname;
    rev = version;
    sha256 = "13m9y0m6gc3mlw3pqv9x4i0him2ycbysizigdvdanhh514kga602";
  };

  nativeBuildInputs = [ libxslt ];

  buildInputs = [ openssl makeWrapper ];

  patchPhase = ''
    substituteInPlace commands.cpp \
      --replace '(escape_shell_arg(our_exe_path()))' '= "git-crypt"'
  '';

  makeFlags = [
    "PREFIX=${placeholder "out"}"
    "ENABLE_MAN=yes"
    "DOCBOOK_XSL=${docbook_xsl}/share/xml/docbook-xsl-nons/manpages/docbook.xsl"
  ];

  postFixup = ''
    wrapProgram $out/bin/git-crypt --prefix PATH : $out/bin:${git}/bin:${gnupg}/bin
  '';

  meta = with stdenv.lib; {
    homepage = "https://www.agwa.name/projects/git-crypt";
    description = "Transparent file encryption in git";
    longDescription = ''
      git-crypt enables transparent encryption and decryption of files in a git
      repository. Files which you choose to protect are encrypted when
      committed, and decrypted when checked out. git-crypt lets you freely
      share a repository containing a mix of public and private
      content. git-crypt gracefully degrades, so developers without the secret
      key can still clone and commit to a repository with encrypted files. This
      lets you store your secret material (such as keys or passwords) in the
      same repository as your code, without requiring you to lock down your
      entire repository.
    '';
    downloadPage = "https://github.com/AGWA/git-crypt/releases";
    license = licenses.gpl3;
    maintainers = [ maintainers.dochang ];
    platforms = platforms.unix;
  };

}