summaryrefslogtreecommitdiff
path: root/overlays/postfwd.nix
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2022-09-13 10:29:35 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2022-09-13 10:29:35 +0200
commitb931543508377c0e48a6801e4ea217eb523e2b03 (patch)
tree373c8ab46c6e78cb69654d816fadf8d6fef1fd28 /overlays/postfwd.nix
parent92dab2dbad09bee9698fc0a9734140af37ca550a (diff)
downloadnixos-b931543508377c0e48a6801e4ea217eb523e2b03.tar
nixos-b931543508377c0e48a6801e4ea217eb523e2b03.tar.gz
nixos-b931543508377c0e48a6801e4ea217eb523e2b03.tar.bz2
nixos-b931543508377c0e48a6801e4ea217eb523e2b03.tar.xz
nixos-b931543508377c0e48a6801e4ea217eb523e2b03.zip
...
Diffstat (limited to 'overlays/postfwd.nix')
-rw-r--r--overlays/postfwd.nix32
1 files changed, 32 insertions, 0 deletions
diff --git a/overlays/postfwd.nix b/overlays/postfwd.nix
new file mode 100644
index 00000000..8a4f4bd8
--- /dev/null
+++ b/overlays/postfwd.nix
@@ -0,0 +1,32 @@
1{ final, prev, sources, ... }:
2let
3 deps = with final.perlPackages; [NetDNS NetServer IOMultiplex NetAddrIP NetCIDRLite DigestMD5 TimeHiRes Storable];
4in {
5 postfwd = prev.stdenv.mkDerivation rec {
6 inherit (sources.postfwd) pname version src;
7
8 nativeBuildInputs = with prev; [ makeWrapper ];
9 propagatedBuildInputs = [final.perlPackages.perl] ++ deps;
10
11 buildPhase = ''
12 runHook preBuild
13
14 substituteInPlace sbin/postfwd3 \
15 --replace "/usr/bin/perl -T" "/usr/bin/perl"
16
17 runHook postBuild
18 '';
19
20 installPhase = ''
21 runHook preInstall
22
23 mkdir -p $out/bin
24 cp -t $out/bin sbin/postfwd3
25
26 wrapProgram $out/bin/postfwd3 \
27 --prefix PERL5LIB : ${final.perlPackages.makePerlPath deps}
28
29 runHook postInstall
30 '';
31 };
32}