dokuwiki: add extraConfigs to combine

Dokuwiki has a plethora of small extra config files. Currently those are
not handled by the combine functionality and have to be added using
`overrideAttrs`.

This adds the `extraConfigs` parameter that takes name-path-pairs that
are then linked into the config folder.
This commit is contained in:
René Neumann
2026-01-12 00:52:41 +01:00
parent 9808fe7a18
commit 9ba60724e1
2 changed files with 15 additions and 7 deletions
+5 -5
View File
@@ -30,11 +30,11 @@ let
r13y reproducibility
'';
dwWithAcronyms = pkgs.dokuwiki.overrideAttrs (prev: {
installPhase = prev.installPhase or "" + ''
ln -sf ${acronymsFile} $out/share/dokuwiki/conf/acronyms.local.conf
'';
});
dwWithAcronyms = pkgs.dokuwiki.combine {
extraConfigs = {
"acronyms.local.conf" = acronymsFile;
};
};
mkNode =
webserver:
+10 -2
View File
@@ -65,6 +65,7 @@ stdenv.mkDerivation rec {
localConfig ? null,
pluginsConfig ? null,
aclConfig ? null,
extraConfigs ? { },
pname ? (p: "${p.pname}-combined"),
}:
let
@@ -76,6 +77,12 @@ stdenv.mkDerivation rec {
""
]
);
configs = {
"local.php" = localConfig;
"plugins.local.php" = pluginsConfig;
}
// extraConfigs;
in
basePackage.overrideAttrs (prev: {
pname = if builtins.isFunction pname then pname prev else pname;
@@ -87,8 +94,9 @@ stdenv.mkDerivation rec {
${lib.concatMapStringsSep "\n" (
plugin: "cp -r ${toString plugin} $out/share/dokuwiki/lib/plugins/${plugin.name}"
) plugins}
${isNotEmpty localConfig "ln -sf ${localConfig} $out/share/dokuwiki/conf/local.php"}
${isNotEmpty pluginsConfig "ln -sf ${pluginsConfig} $out/share/dokuwiki/conf/plugins.local.php"}
${lib.concatMapAttrsStringSep "\n" (
name: path: "${isNotEmpty path "ln -sf ${path} $out/share/dokuwiki/conf/${name}"}"
) configs}
${isNotEmpty aclConfig "ln -sf ${aclConfig} $out/share/dokuwiki/acl.auth.php"}
'';
});