From 505df09d502c2f58063828e03e522ffa29d611d1 Mon Sep 17 00:00:00 2001 From: Aaron Andersen Date: Mon, 1 Jul 2019 15:55:35 -0400 Subject: [PATCH 1/3] nixos/httpd: drop the port option --- .../services/web-servers/apache-httpd/default.nix | 9 +++------ .../web-servers/apache-httpd/per-server-options.nix | 8 -------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/nixos/modules/services/web-servers/apache-httpd/default.nix b/nixos/modules/services/web-servers/apache-httpd/default.nix index bf99f6c132a..12ff94a1f8f 100644 --- a/nixos/modules/services/web-servers/apache-httpd/default.nix +++ b/nixos/modules/services/web-servers/apache-httpd/default.nix @@ -21,10 +21,9 @@ let else [{ip = "*"; port = 80;}]; getListen = cfg: - let list = (lib.optional (cfg.port != 0) {ip = "*"; port = cfg.port;}) ++ cfg.listen; - in if list == [] - then defaultListen cfg - else list; + if cfg.listen == [] + then defaultListen cfg + else cfg.listen; listenToString = l: "${l.ip}:${toString l.port}"; @@ -638,8 +637,6 @@ in message = "SSL is enabled for httpd, but sslServerCert and/or sslServerKey haven't been specified."; } ]; - 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); - users.users = optionalAttrs (mainCfg.user == "wwwrun") (singleton { name = "wwwrun"; group = mainCfg.group; diff --git a/nixos/modules/services/web-servers/apache-httpd/per-server-options.nix b/nixos/modules/services/web-servers/apache-httpd/per-server-options.nix index 4bbd041b6e0..536e707137c 100644 --- a/nixos/modules/services/web-servers/apache-httpd/per-server-options.nix +++ b/nixos/modules/services/web-servers/apache-httpd/per-server-options.nix @@ -24,14 +24,6 @@ with lib; ''; }; - port = mkOption { - type = types.int; - default = 0; - description = '' - Port for the server. Option will be removed, use instead. - ''; - }; - listen = mkOption { type = types.listOf (types.submodule ( { From 0fd69629c703a508a3529463604140caa059e349 Mon Sep 17 00:00:00 2001 From: Aaron Andersen Date: Mon, 1 Jul 2019 16:10:14 -0400 Subject: [PATCH 2/3] nixos/httpd: mark extraSubservices option as deprecated --- nixos/doc/manual/release-notes/rl-1909.xml | 12 +++++++++--- .../services/web-servers/apache-httpd/default.nix | 2 ++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/nixos/doc/manual/release-notes/rl-1909.xml b/nixos/doc/manual/release-notes/rl-1909.xml index c8739d04638..e04945e2730 100644 --- a/nixos/doc/manual/release-notes/rl-1909.xml +++ b/nixos/doc/manual/release-notes/rl-1909.xml @@ -149,9 +149,15 @@ - Several of the apache subservices have been replaced with full NixOS - modules including LimeSurvey, WordPress, and Zabbix. - These modules can be enabled using the , + The option has been + marked as deprecated. You may still use this feature, but it will be + removed in a future release of NixOS. You are encouraged to convert any + httpd subservices you may have written to a full NixOS module. + + + Most of the httpd subservices packaged with NixOS have been replaced with + full NixOS modules including LimeSurvey, WordPress, and Zabbix. These + modules can be enabled using the , , and options. diff --git a/nixos/modules/services/web-servers/apache-httpd/default.nix b/nixos/modules/services/web-servers/apache-httpd/default.nix index 12ff94a1f8f..d6cb5bd4471 100644 --- a/nixos/modules/services/web-servers/apache-httpd/default.nix +++ b/nixos/modules/services/web-servers/apache-httpd/default.nix @@ -637,6 +637,8 @@ in message = "SSL is enabled for httpd, but sslServerCert and/or sslServerKey haven't been specified."; } ]; + 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); + users.users = optionalAttrs (mainCfg.user == "wwwrun") (singleton { name = "wwwrun"; group = mainCfg.group; From 9b970d07f384f31737cb3d598913aba16dbc59bb Mon Sep 17 00:00:00 2001 From: Aaron Andersen Date: Tue, 2 Jul 2019 11:53:45 -0400 Subject: [PATCH 3/3] nixos/httpd: drop postgresql reference --- nixos/doc/manual/release-notes/rl-1909.xml | 5 +++++ nixos/modules/services/web-servers/apache-httpd/default.nix | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/nixos/doc/manual/release-notes/rl-1909.xml b/nixos/doc/manual/release-notes/rl-1909.xml index e04945e2730..53fec6c9b62 100644 --- a/nixos/doc/manual/release-notes/rl-1909.xml +++ b/nixos/doc/manual/release-notes/rl-1909.xml @@ -148,6 +148,11 @@ + + The httpd service no longer attempts to start the postgresql service. If you have come to depend + on this behaviour then you can preserve the behavior with the following configuration: + systemd.services.httpd.after = [ "postgresql.service" ]; + The option has been marked as deprecated. You may still use this feature, but it will be diff --git a/nixos/modules/services/web-servers/apache-httpd/default.nix b/nixos/modules/services/web-servers/apache-httpd/default.nix index d6cb5bd4471..ea9476a7c91 100644 --- a/nixos/modules/services/web-servers/apache-httpd/default.nix +++ b/nixos/modules/services/web-servers/apache-httpd/default.nix @@ -671,7 +671,7 @@ in wantedBy = [ "multi-user.target" ]; wants = [ "keys.target" ]; - after = [ "network.target" "fs.target" "postgresql.service" "keys.target" ]; + after = [ "network.target" "fs.target" "keys.target" ]; path = [ httpd pkgs.coreutils pkgs.gnugrep ]