diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-05-14 08:47:00 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-05-14 09:41:18 +0200 |
commit | daf64e3f7de98e4267823d14fa34891b27b5f657 (patch) | |
tree | 82a3bc59b1bff35b7cd2fc4aeb02e0485e5b37a0 /modules/private | |
parent | 017cb76f3355369a57cee7e851e013fbe7b265b7 (diff) | |
download | Nix-daf64e3f7de98e4267823d14fa34891b27b5f657.tar.gz Nix-daf64e3f7de98e4267823d14fa34891b27b5f657.tar.zst Nix-daf64e3f7de98e4267823d14fa34891b27b5f657.zip |
Start moving websites configuration to modules
Diffstat (limited to 'modules/private')
-rw-r--r-- | modules/private/default.nix | 2 | ||||
-rw-r--r-- | modules/private/httpd-service-builder.nix | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/modules/private/default.nix b/modules/private/default.nix index ba46374..6c71af3 100644 --- a/modules/private/default.nix +++ b/modules/private/default.nix | |||
@@ -1,6 +1,6 @@ | |||
1 | { | 1 | { |
2 | # adatped from nixpkgs/nixos/modules/services/web-servers/apache-httpd/default.nix | 2 | # adatped from nixpkgs/nixos/modules/services/web-servers/apache-httpd/default.nix |
3 | httpdProd = import ./httpd-service-builder.nix { httpdName = "Prod"; withUsers = false; }; | ||
4 | httpdInte = import ./httpd-service-builder.nix { httpdName = "Inte"; withUsers = false; }; | 3 | httpdInte = import ./httpd-service-builder.nix { httpdName = "Inte"; withUsers = false; }; |
4 | httpdProd = import ./httpd-service-builder.nix { httpdName = "Prod"; withUsers = false; }; | ||
5 | httpdTools = import ./httpd-service-builder.nix { httpdName = "Tools"; withUsers = true; }; | 5 | httpdTools = import ./httpd-service-builder.nix { httpdName = "Tools"; withUsers = true; }; |
6 | } | 6 | } |
diff --git a/modules/private/httpd-service-builder.nix b/modules/private/httpd-service-builder.nix index 0f0fe22..d049202 100644 --- a/modules/private/httpd-service-builder.nix +++ b/modules/private/httpd-service-builder.nix | |||
@@ -7,7 +7,7 @@ with lib; | |||
7 | 7 | ||
8 | let | 8 | let |
9 | 9 | ||
10 | mainCfg = config.services."httpd${httpdName}"; | 10 | mainCfg = config.services.httpd."${httpdName}"; |
11 | 11 | ||
12 | httpd = mainCfg.package.out; | 12 | httpd = mainCfg.package.out; |
13 | 13 | ||
@@ -438,7 +438,7 @@ in | |||
438 | 438 | ||
439 | options = { | 439 | options = { |
440 | 440 | ||
441 | services."httpd${httpdName}" = { | 441 | services.httpd."${httpdName}" = { |
442 | 442 | ||
443 | enable = mkOption { | 443 | enable = mkOption { |
444 | type = types.bool; | 444 | type = types.bool; |
@@ -655,7 +655,7 @@ in | |||
655 | 655 | ||
656 | ###### implementation | 656 | ###### implementation |
657 | 657 | ||
658 | config = mkIf config.services."httpd${httpdName}".enable { | 658 | config = mkIf config.services.httpd."${httpdName}".enable { |
659 | 659 | ||
660 | assertions = [ { assertion = mainCfg.enableSSL == true | 660 | assertions = [ { assertion = mainCfg.enableSSL == true |
661 | -> mainCfg.sslServerCert != null | 661 | -> mainCfg.sslServerCert != null |
@@ -679,7 +679,7 @@ in | |||
679 | 679 | ||
680 | environment.systemPackages = [httpd] ++ concatMap (svc: svc.extraPath) allSubservices; | 680 | environment.systemPackages = [httpd] ++ concatMap (svc: svc.extraPath) allSubservices; |
681 | 681 | ||
682 | services."httpd${httpdName}".phpOptions = | 682 | services.httpd."${httpdName}".phpOptions = |
683 | '' | 683 | '' |
684 | ; Needed for PHP's mail() function. | 684 | ; Needed for PHP's mail() function. |
685 | sendmail_path = sendmail -t -i | 685 | sendmail_path = sendmail -t -i |