2023-10-09 19:29:22 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, git, makeWrapper, openssl, coreutils, util-linux, gnugrep, gnused, gawk, testers, transcrypt }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "transcrypt";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "2.3.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "elasticdog";
|
|
|
|
repo = "transcrypt";
|
|
|
|
rev = "v${version}";
|
2024-09-19 14:19:46 +00:00
|
|
|
sha256 = "sha256-hevKqs0JKsRI2qTRzWAAuMotiBX6dGF0ZmypBco2l6g=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
buildInputs = [ git openssl coreutils util-linux gnugrep gnused gawk ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
install -m 755 -D transcrypt $out/bin/transcrypt
|
|
|
|
install -m 644 -D man/transcrypt.1 $out/share/man/man1/transcrypt.1
|
|
|
|
install -m 644 -D contrib/bash/transcrypt $out/share/bash-completion/completions/transcrypt
|
|
|
|
install -m 644 -D contrib/zsh/_transcrypt $out/share/zsh/site-functions/_transcrypt
|
|
|
|
|
|
|
|
wrapProgram $out/bin/transcrypt \
|
2021-01-17 00:15:33 +00:00
|
|
|
--prefix PATH : "${lib.makeBinPath [ git openssl coreutils util-linux gnugrep gnused gawk ]}"
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
cat > $out/bin/transcrypt-depspathprefix << EOF
|
|
|
|
#!${stdenv.shell}
|
2021-01-17 00:15:33 +00:00
|
|
|
echo "${lib.makeBinPath [ git openssl coreutils gawk ]}:"
|
2020-04-24 23:36:52 +00:00
|
|
|
EOF
|
|
|
|
chmod +x $out/bin/transcrypt-depspathprefix
|
|
|
|
'';
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = transcrypt;
|
|
|
|
command = "transcrypt --version";
|
|
|
|
version = "transcrypt ${version}";
|
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Transparently encrypt files within a Git repository";
|
|
|
|
longDescription = ''
|
|
|
|
A script to configure transparent encryption of sensitive files stored in
|
|
|
|
a Git repository. Files that you choose will be automatically encrypted
|
|
|
|
when you commit them, and automatically decrypted when you check them
|
|
|
|
out. The process will degrade gracefully, so even people without your
|
|
|
|
encryption password can safely commit changes to the repository's
|
|
|
|
non-encrypted files.
|
|
|
|
'';
|
|
|
|
homepage = "https://github.com/elasticdog/transcrypt";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.elasticdog ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|