From f0b4a5da478003f11da0aaaa38be02afacd4e4d9 Mon Sep 17 00:00:00 2001 From: Shamrock Lee <44064051+ShamrockLee@users.noreply.github.com> Date: Mon, 11 Jul 2022 01:48:19 +0800 Subject: [PATCH] voms: default to symlink $out/etc to /etc --- pkgs/tools/networking/voms/default.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkgs/tools/networking/voms/default.nix b/pkgs/tools/networking/voms/default.nix index 2dd5643e740..a16648b9a83 100644 --- a/pkgs/tools/networking/voms/default.nix +++ b/pkgs/tools/networking/voms/default.nix @@ -11,6 +11,10 @@ , gsoap , openssl , zlib + # Configuration overridable with .override + # If not null, the builder will + # move "$out/etc" to "$out/etc.orig" and symlink "$out/etc" to externalEtc. +, externalEtc ? "/etc" }: stdenv.mkDerivation rec{ @@ -24,6 +28,10 @@ stdenv.mkDerivation rec{ hash = "sha256-FG4fHO2lsQ3t/ZaKT9xY+xqdQHfdtzi5ULtxLhdPnss="; }; + passthru = { + inherit externalEtc; + }; + nativeBuildInputs = [ autoreconfHook bison @@ -59,6 +67,13 @@ stdenv.mkDerivation rec{ "--with-gsoap-wsdl2h=${gsoap}/bin/wsdl2h" ]; + postFixup = '' + ${lib.optionalString (externalEtc != null) '' + mv "$out"/etc{,.orig} + ln -s ${lib.escapeShellArg externalEtc} "$out/etc" + ''} + ''; + meta = with lib; { description = "The C/C++ VOMS server, client and APIs v2.x"; homepage = "https://italiangrid.github.io/voms/";