diff options
Diffstat (limited to 'modules/webapps/mediagoblin.nix')
-rw-r--r-- | modules/webapps/mediagoblin.nix | 29 |
1 files changed, 8 insertions, 21 deletions
diff --git a/modules/webapps/mediagoblin.nix b/modules/webapps/mediagoblin.nix index dbc4c2b..19bbc2e 100644 --- a/modules/webapps/mediagoblin.nix +++ b/modules/webapps/mediagoblin.nix | |||
@@ -15,8 +15,8 @@ let | |||
15 | 15 | ||
16 | [app:mediagoblin] | 16 | [app:mediagoblin] |
17 | use = egg:mediagoblin#app | 17 | use = egg:mediagoblin#app |
18 | config = ${cfg.configFile} ${cfg.workdir}/mediagoblin.ini | 18 | config = ${cfg.configFile} ${cfg.package}/mediagoblin.ini |
19 | /mgoblin_static = ${cfg.workdir}/mediagoblin/static | 19 | /mgoblin_static = ${cfg.package}/mediagoblin/static |
20 | 20 | ||
21 | [loggers] | 21 | [loggers] |
22 | keys = root | 22 | keys = root |
@@ -87,26 +87,13 @@ in | |||
87 | package = lib.mkOption { | 87 | package = lib.mkOption { |
88 | type = lib.types.package; | 88 | type = lib.types.package; |
89 | default = pkgs.webapps.mediagoblin; | 89 | default = pkgs.webapps.mediagoblin; |
90 | example = lib.literalExample '' | ||
91 | pkgs.webapps.mediagoblin.withPlugins (p: [p.basicsearch]) | ||
92 | ''; | ||
90 | description = '' | 93 | description = '' |
91 | Mediagoblin package to use. | 94 | Mediagoblin package to use. |
92 | ''; | 95 | ''; |
93 | }; | 96 | }; |
94 | plugins = lib.mkOption { | ||
95 | type = lib.types.listOf lib.types.package; | ||
96 | default = []; | ||
97 | description = '' | ||
98 | Mediagoblin plugins to use. | ||
99 | ''; | ||
100 | }; | ||
101 | # Output variables | ||
102 | workdir = lib.mkOption { | ||
103 | type = lib.types.package; | ||
104 | default = cfg.package.withPlugins cfg.plugins; | ||
105 | description = '' | ||
106 | Adjusted Mediagoblin package with plugins | ||
107 | ''; | ||
108 | readOnly = true; | ||
109 | }; | ||
110 | systemdStateDirectory = lib.mkOption { | 97 | systemdStateDirectory = lib.mkOption { |
111 | type = lib.types.str; | 98 | type = lib.types.str; |
112 | # Use ReadWritePaths= instead if varDir is outside of /var/lib | 99 | # Use ReadWritePaths= instead if varDir is outside of /var/lib |
@@ -187,7 +174,7 @@ in | |||
187 | preStart = '' | 174 | preStart = '' |
188 | if [ -d ${cfg.dataDir}/plugin_static/ ]; then | 175 | if [ -d ${cfg.dataDir}/plugin_static/ ]; then |
189 | rm ${cfg.dataDir}/plugin_static/coreplugin_basic_auth | 176 | rm ${cfg.dataDir}/plugin_static/coreplugin_basic_auth |
190 | ln -sf ${cfg.workdir}/mediagoblin/plugins/basic_auth/static ${cfg.dataDir}/plugin_static/coreplugin_basic_auth | 177 | ln -sf ${cfg.package}/mediagoblin/plugins/basic_auth/static ${cfg.dataDir}/plugin_static/coreplugin_basic_auth |
191 | fi | 178 | fi |
192 | ./bin/gmg -cf ${cfg.configFile} dbupdate | 179 | ./bin/gmg -cf ${cfg.configFile} dbupdate |
193 | ''; | 180 | ''; |
@@ -198,7 +185,7 @@ in | |||
198 | Restart = "always"; | 185 | Restart = "always"; |
199 | TimeoutSec = 15; | 186 | TimeoutSec = 15; |
200 | Type = "simple"; | 187 | Type = "simple"; |
201 | WorkingDirectory = cfg.workdir; | 188 | WorkingDirectory = cfg.package; |
202 | RuntimeDirectory = cfg.systemdRuntimeDirectory; | 189 | RuntimeDirectory = cfg.systemdRuntimeDirectory; |
203 | StateDirectory= cfg.systemdStateDirectory; | 190 | StateDirectory= cfg.systemdStateDirectory; |
204 | PIDFile = cfg.pids.paster; | 191 | PIDFile = cfg.pids.paster; |
@@ -227,7 +214,7 @@ in | |||
227 | Restart = "always"; | 214 | Restart = "always"; |
228 | TimeoutSec = 60; | 215 | TimeoutSec = 60; |
229 | Type = "simple"; | 216 | Type = "simple"; |
230 | WorkingDirectory = cfg.workdir; | 217 | WorkingDirectory = cfg.package; |
231 | RuntimeDirectory = cfg.systemdRuntimeDirectory; | 218 | RuntimeDirectory = cfg.systemdRuntimeDirectory; |
232 | StateDirectory= cfg.systemdStateDirectory; | 219 | StateDirectory= cfg.systemdStateDirectory; |
233 | PIDFile = cfg.pids.celery; | 220 | PIDFile = cfg.pids.celery; |