File tree Expand file tree Collapse file tree 3 files changed +30
-10
lines changed
modules/services/web-apps Expand file tree Collapse file tree 3 files changed +30
-10
lines changed Original file line number Diff line number Diff line change 115115 pkg =
116116 hostName : cfg :
117117 cfg . package . combine {
118- inherit ( cfg ) plugins templates ;
118+ inherit ( cfg ) plugins templates extraConfigs ;
119119
120120 pname = p : "${ p . pname } -${ hostName } " ;
121121
345345 '' ;
346346 } ;
347347
348+ extraConfigs = mkOption {
349+ type = types . attrsOf types . path ;
350+ default = { } ;
351+ description = ''
352+ Path(s) to additional configuration files that are then linked to the 'conf' directory.
353+ '' ;
354+ example = literalExpression ''
355+ {
356+ "acronyms.local.conf" = pkgs.writeText "acronyms.local.conf" '''
357+ r13y reproducibility
358+ ''' ;
359+ "entities.local.conf" = ./dokuwiki-entities;
360+ }
361+ '' ;
362+ } ;
363+
348364 poolConfig = mkOption {
349365 type =
350366 with types ;
Original file line number Diff line number Diff line change 3030 r13y reproducibility
3131 '' ;
3232
33- dwWithAcronyms = pkgs . dokuwiki . overrideAttrs ( prev : {
34- installPhase = prev . installPhase or "" + ''
35- ln -sf ${ acronymsFile } $out/share/dokuwiki/conf/acronyms.local.conf
36- '' ;
37- } ) ;
38-
3933 mkNode =
4034 webserver :
4135 { ... } :
5347 } ;
5448 } ;
5549 "site2.local" = {
56- package = dwWithAcronyms ;
5750 usersFile = "/var/lib/dokuwiki/site2.local/users.auth.php" ;
5851 plugins = [ plugin-icalevents ] ;
52+ extraConfigs = {
53+ "acronyms.local.conf" = acronymsFile ;
54+ } ;
5955 settings = {
6056 useacl = true ;
6157 superuser = "admin" ;
Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ stdenv.mkDerivation rec {
6565 localConfig ? null ,
6666 pluginsConfig ? null ,
6767 aclConfig ? null ,
68+ extraConfigs ? { } ,
6869 pname ? ( p : "${ p . pname } -combined" ) ,
6970 } :
7071 let
@@ -76,6 +77,12 @@ stdenv.mkDerivation rec {
7677 ""
7778 ]
7879 ) ;
80+
81+ configs = {
82+ "local.php" = localConfig ;
83+ "plugins.local.php" = pluginsConfig ;
84+ }
85+ // extraConfigs ;
7986 in
8087 basePackage . overrideAttrs ( prev : {
8188 pname = if builtins . isFunction pname then pname prev else pname ;
@@ -87,8 +94,9 @@ stdenv.mkDerivation rec {
8794 ${ lib . concatMapStringsSep "\n " (
8895 plugin : "cp -r ${ toString plugin } $out/share/dokuwiki/lib/plugins/${ plugin . name } "
8996 ) plugins }
90- ${ isNotEmpty localConfig "ln -sf ${ localConfig } $out/share/dokuwiki/conf/local.php" }
91- ${ isNotEmpty pluginsConfig "ln -sf ${ pluginsConfig } $out/share/dokuwiki/conf/plugins.local.php" }
97+ ${ lib . concatMapAttrsStringSep "\n " (
98+ name : path : "${ isNotEmpty path "ln -sf ${ path } $out/share/dokuwiki/conf/${ name } " } "
99+ ) configs }
92100 ${ isNotEmpty aclConfig "ln -sf ${ aclConfig } $out/share/dokuwiki/acl.auth.php" }
93101 '' ;
94102 } ) ;
You can’t perform that action at this time.
0 commit comments