about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJason Vigil <jason@0xc45.com>2022-06-25 07:16:50 -0700
committerJason Vigil <jason@0xc45.com>2022-06-25 10:21:14 -0700
commit5efa54db61ec1360c8998884bd08ff520d5790f8 (patch)
treea70ee399e31eecc7ad8205df784070729095011c
parent2b3a93f65bb31cc1a82805256a48f26fff53d92d (diff)
regpg: init at 1.11
-rw-r--r--pkgs/tools/security/regpg/default.nix52
-rw-r--r--pkgs/top-level/all-packages.nix2
2 files changed, 54 insertions, 0 deletions
diff --git a/pkgs/tools/security/regpg/default.nix b/pkgs/tools/security/regpg/default.nix
new file mode 100644
index 0000000000000..aaefbef227b88
--- /dev/null
+++ b/pkgs/tools/security/regpg/default.nix
@@ -0,0 +1,52 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, makeWrapper
+, gnupg
+, perl
+}:
+
+let
+  perlEnv = perl.withPackages (p: with p; [ TextMarkdown ]);
+in
+stdenv.mkDerivation rec {
+  pname = "regpg";
+  version = "1.11";
+
+  src = fetchFromGitHub {
+    owner = "fanf2";
+    repo = "regpg";
+    rev = "regpg-${version}";
+    sha256 = "2ea99950804078190e1cc2a76d4740e3fdd5395a9043db3f3fe86bf2477d3a7d";
+  };
+
+  nativeBuildInputs = [ makeWrapper perlEnv ];
+
+  postPatch = ''
+    patchShebangs ./util/insert-here.pl ./util/markdown.pl
+    substituteInPlace ./Makefile \
+      --replace 'util/insert-here.pl' 'perl util/insert-here.pl'
+    substituteInPlace ./Makefile \
+      --replace 'util/markdown.pl' 'perl util/markdown.pl'
+    substituteInPlace util/insert-here.pl \
+      --replace 'qx(git describe)' '"regpg-${version}"'
+  '';
+
+  dontConfigure = true;
+
+  makeFlags = [ "prefix=$(out)" ];
+
+  postFixup = ''
+    patchShebangs $out/bin/regpg
+    wrapProgram $out/bin/regpg --prefix PATH ":" \
+      "${lib.makeBinPath [ gnupg ]}"
+  '';
+
+  meta = with lib; {
+    description = "GPG wrapper utility for storing secrets in VCS";
+    homepage = "https://dotat.at/prog/regpg";
+    license = licenses.gpl3;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ _0xC45 ];
+  };
+}
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 238e2537d2bfd..da8ed65c70f04 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -9977,6 +9977,8 @@ with pkgs;
 
   reftools = callPackage ../development/tools/reftools { };
 
+  regpg = callPackage ../tools/security/regpg { };
+
   remote-touchpad = callPackage ../tools/inputmethods/remote-touchpad { };
 
   reposurgeon = callPackage ../applications/version-management/reposurgeon { };