From 9ba60724e1bfeee2b0a9ae87243b027b83f8b4d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Neumann?= Date: Sun, 11 Jan 2026 23:25:05 +0100 Subject: [PATCH 1/2] 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. --- nixos/tests/dokuwiki.nix | 10 +++++----- pkgs/by-name/do/dokuwiki/package.nix | 12 ++++++++++-- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/nixos/tests/dokuwiki.nix b/nixos/tests/dokuwiki.nix index 2e30ab269c22..dae7105172cb 100644 --- a/nixos/tests/dokuwiki.nix +++ b/nixos/tests/dokuwiki.nix @@ -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: diff --git a/pkgs/by-name/do/dokuwiki/package.nix b/pkgs/by-name/do/dokuwiki/package.nix index 980073366c38..0796e233496a 100644 --- a/pkgs/by-name/do/dokuwiki/package.nix +++ b/pkgs/by-name/do/dokuwiki/package.nix @@ -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"} ''; }); From 8b4f523448a2b5fb2f7909ae700ba7dc70579d8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Neumann?= Date: Mon, 12 Jan 2026 00:34:52 +0100 Subject: [PATCH 2/2] nixos/dokuwiki: Support `extraConfigs` in combine Add a new option `extraConfigs` that is then passed to the improved `combine` function. --- nixos/modules/services/web-apps/dokuwiki.nix | 18 +++++++++++++++++- nixos/tests/dokuwiki.nix | 10 +++------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/nixos/modules/services/web-apps/dokuwiki.nix b/nixos/modules/services/web-apps/dokuwiki.nix index d1c0d2103522..456403c1b07f 100644 --- a/nixos/modules/services/web-apps/dokuwiki.nix +++ b/nixos/modules/services/web-apps/dokuwiki.nix @@ -115,7 +115,7 @@ let pkg = hostName: cfg: cfg.package.combine { - inherit (cfg) plugins templates; + inherit (cfg) plugins templates extraConfigs; pname = p: "${p.pname}-${hostName}"; @@ -345,6 +345,22 @@ let ''; }; + extraConfigs = mkOption { + type = types.attrsOf types.path; + default = { }; + description = '' + Path(s) to additional configuration files that are then linked to the 'conf' directory. + ''; + example = literalExpression '' + { + "acronyms.local.conf" = pkgs.writeText "acronyms.local.conf" ''' + r13y reproducibility + '''; + "entities.local.conf" = ./dokuwiki-entities; + } + ''; + }; + poolConfig = mkOption { type = with types; diff --git a/nixos/tests/dokuwiki.nix b/nixos/tests/dokuwiki.nix index dae7105172cb..7aa6e4f5857a 100644 --- a/nixos/tests/dokuwiki.nix +++ b/nixos/tests/dokuwiki.nix @@ -30,12 +30,6 @@ let r13y reproducibility ''; - dwWithAcronyms = pkgs.dokuwiki.combine { - extraConfigs = { - "acronyms.local.conf" = acronymsFile; - }; - }; - mkNode = webserver: { ... }: @@ -53,9 +47,11 @@ let }; }; "site2.local" = { - package = dwWithAcronyms; usersFile = "/var/lib/dokuwiki/site2.local/users.auth.php"; plugins = [ plugin-icalevents ]; + extraConfigs = { + "acronyms.local.conf" = acronymsFile; + }; settings = { useacl = true; superuser = "admin";