git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #64151 from aanderse/httpd-extraSubservices

nixos/httpd: module cleanup

commit72ef4786e160147660055787650b138fc2a69c40 authorAaron Andersen <aaron@fosslib.net> dateTue 23 Jul 2019, 21:58 (7 years ago) parenta4796209b970d0
3 files changed+19−17
nixos/doc/manual/release-notes/rl-1909.xml+14−3 nixos/modules/services/web-servers/apache-httpd/default.nix+5−6 nixos/modules/services/web-servers/apache-httpd/per-server-options.nix−8
nixos/doc/manual/release-notes/rl-1909.xml+14−3
@@ -149,9 +149,20 @@
149149 </listitem>
150150 <listitem>
151151 <para>
152− Several of the apache subservices have been replaced with full NixOS
153− modules including LimeSurvey, WordPress, and Zabbix.
154− These modules can be enabled using the <option>services.limesurvey.enable</option>,
152+ The httpd service no longer attempts to start the postgresql service. If you have come to depend
153+ on this behaviour then you can preserve the behavior with the following configuration:
154+ <literal>systemd.services.httpd.after = [ "postgresql.service" ];</literal>
155+ </para>
156+ <para>
157+ The option <option>services.httpd.extraSubservices</option> has been
158+ marked as deprecated. You may still use this feature, but it will be
159+ removed in a future release of NixOS. You are encouraged to convert any
160+ httpd subservices you may have written to a full NixOS module.
161+ </para>
162+ <para>
163+ Most of the httpd subservices packaged with NixOS have been replaced with
164+ full NixOS modules including LimeSurvey, WordPress, and Zabbix. These
165+ modules can be enabled using the <option>services.limesurvey.enable</option>,
155166 <option>services.wordpress.enable</option>, and <option>services.zabbixWeb.enable</option> options.
156167 </para>
157168 </listitem>
nixos/modules/services/web-servers/apache-httpd/default.nix+5−6
@@ -21,10 +21,9 @@ let
2121 else [{ip = "*"; port = 80;}];
2222
2323 getListen = cfg:
24− let list = (lib.optional (cfg.port != 0) {ip = "*"; port = cfg.port;}) ++ cfg.listen;
25− in if list == []
26− then defaultListen cfg
27− else list;
24+ if cfg.listen == []
25+ then defaultListen cfg
26+ else cfg.listen;
2827
2928 listenToString = l: "${l.ip}:${toString l.port}";
3029
@@ -638,7 +637,7 @@ in
638637 message = "SSL is enabled for httpd, but sslServerCert and/or sslServerKey haven't been specified."; }
639638 ];
640639
641− warnings = map (cfg: ''apache-httpd's port option is deprecated. Use listen = [{/*ip = "*"; */ port = ${toString cfg.port};}]; instead'' ) (lib.filter (cfg: cfg.port != 0) allHosts);
640+ warnings = map (cfg: "apache-httpd's extraSubservices option is deprecated. Most existing subservices have been ported to the NixOS module system. Please update your configuration accordingly.") (lib.filter (cfg: cfg.extraSubservices != []) allHosts);
642641
643642 users.users = optionalAttrs (mainCfg.user == "wwwrun") (singleton
644643 { name = "wwwrun";
@@ -672,7 +671,7 @@ in
672671
673672 wantedBy = [ "multi-user.target" ];
674673 wants = [ "keys.target" ];
675− after = [ "network.target" "fs.target" "postgresql.service" "keys.target" ];
674+ after = [ "network.target" "fs.target" "keys.target" ];
676675
677676 path =
678677 [ httpd pkgs.coreutils pkgs.gnugrep ]
nixos/modules/services/web-servers/apache-httpd/per-server-options.nix−8
@@ -24,14 +24,6 @@ with lib;
2424 '';
2525 };
2626
27− port = mkOption {
28− type = types.int;
29− default = 0;
30− description = ''
31− Port for the server. Option will be removed, use <option>listen</option> instead.
32− '';
33− };
34−
3527 listen = mkOption {
3628 type = types.listOf (types.submodule (
3729 {