1{ fetchFromGitHub, git, gnupg1compat, makeWrapper, openssl, stdenv }:
2
3stdenv.mkDerivation rec {
4
5 name = "git-crypt-${meta.version}";
6
7 src = fetchFromGitHub {
8 owner = "AGWA";
9 repo = "git-crypt";
10 rev = meta.version;
11 sha256 = "4fe45f903a4b3cc06a5fe11334b914c225009fe8440d9e91a54fdf21cf4dcc4d";
12 inherit name;
13 };
14
15 buildInputs = [ openssl makeWrapper ];
16
17 patchPhase = ''
18 substituteInPlace commands.cpp \
19 --replace '(escape_shell_arg(our_exe_path()))' '= "git-crypt"'
20 '';
21
22 installPhase = ''
23 make install PREFIX=$out
24 wrapProgram $out/bin/* --prefix PATH : $out/bin:${git}/bin:${gnupg1compat}/bin
25 '';
26
27 meta = with stdenv.lib; {
28 homepage = https://www.agwa.name/projects/git-crypt;
29 description = "Transparent file encryption in git";
30 longDescription = ''
31 git-crypt enables transparent encryption and decryption of files in a git
32 repository. Files which you choose to protect are encrypted when
33 committed, and decrypted when checked out. git-crypt lets you freely
34 share a repository containing a mix of public and private
35 content. git-crypt gracefully degrades, so developers without the secret
36 key can still clone and commit to a repository with encrypted files. This
37 lets you store your secret material (such as keys or passwords) in the
38 same repository as your code, without requiring you to lock down your
39 entire repository.
40 '';
41 downloadPage = "https://github.com/AGWA/git-crypt/releases";
42 license = licenses.gpl3;
43 version = "0.5.0";
44 maintainers = [ maintainers.dochang ];
45 platforms = platforms.unix;
46 };
47
48}