aboutsummaryrefslogtreecommitdiff
path: root/modules/websites/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/websites/default.nix')
-rw-r--r--modules/websites/default.nix35
1 files changed, 0 insertions, 35 deletions
diff --git a/modules/websites/default.nix b/modules/websites/default.nix
index 0a78c13..6658c66 100644
--- a/modules/websites/default.nix
+++ b/modules/websites/default.nix
@@ -7,22 +7,6 @@ in
7 certs = mkOption { 7 certs = mkOption {
8 description = "Default websites configuration for certificates as accepted by acme"; 8 description = "Default websites configuration for certificates as accepted by acme";
9 }; 9 };
10 webappDirs = mkOption {
11 description = ''
12 Defines a symlink between /run/current-system/webapps and a store
13 app directory to be used in http configuration. Permits to avoid
14 restarting httpd when only the folder name changes.
15 '';
16 type = types.attrsOf types.path;
17 default = {};
18 };
19 webappDirsName = mkOption {
20 type = str;
21 default = "webapps";
22 description = ''
23 Name of the webapp dir to create in /run/current-system
24 '';
25 };
26 env = mkOption { 10 env = mkOption {
27 default = {}; 11 default = {};
28 description = "Each type of website to enable will target a distinct httpd server"; 12 description = "Each type of website to enable will target a distinct httpd server";
@@ -145,17 +129,6 @@ in
145 }; 129 };
146 }); 130 });
147 }; 131 };
148 # Readonly variables
149 webappDirsPaths = mkOption {
150 type = attrsOf path;
151 readOnly = true;
152 description = ''
153 Full paths of the webapp dir
154 '';
155 default = attrsets.mapAttrs' (name: icfg: attrsets.nameValuePair
156 name "/run/current-system/${cfg.webappDirsName}/${name}"
157 ) cfg.webappDirs;
158 };
159 }; 132 };
160 133
161 config.services.httpd = let 134 config.services.httpd = let
@@ -268,14 +241,6 @@ in
268 } 241 }
269 ) groupedCerts; 242 ) groupedCerts;
270 243
271 config.system.extraSystemBuilderCmds = lib.mkIf (builtins.length (builtins.attrValues cfg.webappDirs) > 0) ''
272 mkdir -p $out/${cfg.webappDirsName}
273 ${builtins.concatStringsSep "\n"
274 (attrsets.mapAttrsToList
275 (name: path: "ln -s ${path} $out/${cfg.webappDirsName}/${name}") cfg.webappDirs)
276 }
277 '';
278
279 config.systemd.services = let 244 config.systemd.services = let
280 package = httpdName: config.services.httpd.${httpdName}.package.out; 245 package = httpdName: config.services.httpd.${httpdName}.package.out;
281 cfgFile = httpdName: config.services.httpd.${httpdName}.configFile; 246 cfgFile = httpdName: config.services.httpd.${httpdName}.configFile;