nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 makeWrapper,
6 gnupg,
7 perl,
8}:
9
10let
11 perlEnv = perl.withPackages (p: with p; [ TextMarkdown ]);
12in
13stdenv.mkDerivation rec {
14 pname = "regpg";
15 version = "1.11";
16
17 src = fetchFromGitHub {
18 owner = "fanf2";
19 repo = "regpg";
20 rev = "regpg-${version}";
21 sha256 = "2ea99950804078190e1cc2a76d4740e3fdd5395a9043db3f3fe86bf2477d3a7d";
22 };
23
24 nativeBuildInputs = [
25 makeWrapper
26 perlEnv
27 ];
28
29 postPatch = ''
30 patchShebangs ./util/insert-here.pl ./util/markdown.pl
31 substituteInPlace ./Makefile \
32 --replace 'util/insert-here.pl' 'perl util/insert-here.pl'
33 substituteInPlace ./Makefile \
34 --replace 'util/markdown.pl' 'perl util/markdown.pl'
35 substituteInPlace util/insert-here.pl \
36 --replace 'qx(git describe)' '"regpg-${version}"'
37 '';
38
39 dontConfigure = true;
40
41 makeFlags = [ "prefix=$(out)" ];
42
43 postFixup = ''
44 patchShebangs $out/bin/regpg
45 wrapProgram $out/bin/regpg --prefix PATH ":" \
46 "${lib.makeBinPath [ gnupg ]}"
47 '';
48
49 meta = with lib; {
50 description = "GPG wrapper utility for storing secrets in VCS";
51 mainProgram = "regpg";
52 homepage = "https://dotat.at/prog/regpg";
53 license = licenses.gpl3;
54 platforms = platforms.all;
55 maintainers = with maintainers; [ _0xC45 ];
56 };
57}