voms, xrootd: clean up $out/etc.orig (#241466)

When externalEtc is not null, create an extra output "etc" and move the
"$out/etc" content into "$etc/etc" before creating the symlink at
"$out/etc".
This commit is contained in:
Yueh-Shun Li 2023-10-21 02:35:38 +08:00 committed by GitHub
parent 1542bb6ef5
commit 872fe27639
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 9 deletions

View file

@ -254,6 +254,8 @@
- Garage has been upgraded to 0.9.x. `services.garage.package` now needs to be explicitly set, so version upgrades can be done in a controlled fashion. For this, we expose `garage_x_y` attributes which can be set here.
- `voms` and `xrootd` now moves the `$out/etc` content to the `$etc` output instead of `$out/etc.orig`, when input argument `externalEtc` is not `null`.
- The `woodpecker-*` CI packages have been updated to 1.0.0. This release is wildly incompatible with the 0.15.X versions that were previously packaged. Please read [upstream's documentation](https://woodpecker-ci.org/docs/next/migrations#100) to learn how to update your CI configurations.
- The Caddy module gained a new option named `services.caddy.enableReload` which is enabled by default. It allows reloading the service instead of restarting it, if only a config file has changed. This option must be disabled if you have turned off the [Caddy admin API](https://caddyserver.com/docs/caddyfile/options#admin). If you keep this option enabled, you should consider setting [`grace_period`](https://caddyserver.com/docs/caddyfile/options#grace-period) to a non-infinite value to prevent Caddy from delaying the reload indefinitely.

View file

@ -13,7 +13,8 @@
, zlib
# Configuration overridable with .override
# If not null, the builder will
# move "$out/etc" to "$out/etc.orig" and symlink "$out/etc" to externalEtc.
# create a new output "etc", move "$out/etc" to "$etc/etc"
# and symlink "$out/etc" to externalEtc.
, externalEtc ? "/etc"
}:
@ -46,7 +47,8 @@ stdenv.mkDerivation rec{
zlib
];
outputs = [ "bin" "out" "dev" "man" ];
outputs = [ "bin" "out" "dev" "man" ]
++ lib.optional (externalEtc != null) "etc";
preAutoreconf = ''
mkdir -p aux src/autogen
@ -65,13 +67,12 @@ stdenv.mkDerivation rec{
configureFlags = [
"--with-gsoap-wsdl2h=${gsoap}/bin/wsdl2h"
"--sysconfdir=${placeholder "out"}/etc"
];
postFixup = ''
${lib.optionalString (externalEtc != null) ''
mv "$out"/etc{,.orig}
ln -s ${lib.escapeShellArg externalEtc} "$out/etc"
''}
postFixup = lib.optionalString (externalEtc != null) ''
moveToOutput etc "$etc"
ln -s ${lib.escapeShellArg externalEtc} "$out/etc"
'';
meta = with lib; {

View file

@ -39,7 +39,8 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-SLmxv8opN7z4V07S9kLGo8HG7Ql62iZQLtf3zGemwA8=";
};
outputs = [ "bin" "out" "dev" "man" ];
outputs = [ "bin" "out" "dev" "man" ]
++ lib.optional (externalEtc != null) "etc";
passthru.fetchxrd = callPackage ./fetchxrd.nix { xrootd = finalAttrs.finalPackage; };
passthru.tests =
@ -118,7 +119,7 @@ stdenv.mkDerivation (finalAttrs: {
wrapProgram "$FILE" "''${makeWrapperArgs[@]}"
done < <(find "$bin/bin" -mindepth 1 -maxdepth 1 -type f,l -perm -a+x)
'' + lib.optionalString (externalEtc != null) ''
mv "$out"/etc{,.orig}
moveToOutput etc "$etc"
ln -s ${lib.escapeShellArg externalEtc} "$out/etc"
'';