diff options
Diffstat (limited to 'modules/websites/default.nix')
-rw-r--r-- | modules/websites/default.nix | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/modules/websites/default.nix b/modules/websites/default.nix index 767a7b2..3f46e65 100644 --- a/modules/websites/default.nix +++ b/modules/websites/default.nix | |||
@@ -38,7 +38,7 @@ in | |||
38 | description = "Name of the httpd instance to assign this type to"; | 38 | description = "Name of the httpd instance to assign this type to"; |
39 | }; | 39 | }; |
40 | ips = mkOption { | 40 | ips = mkOption { |
41 | type = listOf string; | 41 | type = listOf str; |
42 | default = []; | 42 | default = []; |
43 | description = "ips to listen to"; | 43 | description = "ips to listen to"; |
44 | }; | 44 | }; |
@@ -59,7 +59,7 @@ in | |||
59 | options = { | 59 | options = { |
60 | enable = mkEnableOption "Add default no-ssl vhost for this instance"; | 60 | enable = mkEnableOption "Add default no-ssl vhost for this instance"; |
61 | host = mkOption { | 61 | host = mkOption { |
62 | type = string; | 62 | type = str; |
63 | description = "The hostname to use for this vhost"; | 63 | description = "The hostname to use for this vhost"; |
64 | }; | 64 | }; |
65 | root = mkOption { | 65 | root = mkOption { |
@@ -68,7 +68,7 @@ in | |||
68 | description = "The root folder to serve"; | 68 | description = "The root folder to serve"; |
69 | }; | 69 | }; |
70 | indexFile = mkOption { | 70 | indexFile = mkOption { |
71 | type = string; | 71 | type = str; |
72 | default = "index.html"; | 72 | default = "index.html"; |
73 | description = "The index file to show."; | 73 | description = "The index file to show."; |
74 | }; | 74 | }; |
@@ -79,8 +79,8 @@ in | |||
79 | description = "The fallback vhost that will be defined as first vhost in Apache"; | 79 | description = "The fallback vhost that will be defined as first vhost in Apache"; |
80 | type = submodule { | 80 | type = submodule { |
81 | options = { | 81 | options = { |
82 | certName = mkOption { type = string; }; | 82 | certName = mkOption { type = str; }; |
83 | hosts = mkOption { type = listOf string; }; | 83 | hosts = mkOption { type = listOf str; }; |
84 | root = mkOption { type = nullOr path; }; | 84 | root = mkOption { type = nullOr path; }; |
85 | extraConfig = mkOption { type = listOf lines; default = []; }; | 85 | extraConfig = mkOption { type = listOf lines; default = []; }; |
86 | }; | 86 | }; |
@@ -91,7 +91,7 @@ in | |||
91 | description = "List of no ssl vhosts to define for Apache"; | 91 | description = "List of no ssl vhosts to define for Apache"; |
92 | type = attrsOf (submodule { | 92 | type = attrsOf (submodule { |
93 | options = { | 93 | options = { |
94 | hosts = mkOption { type = listOf string; }; | 94 | hosts = mkOption { type = listOf str; }; |
95 | root = mkOption { type = nullOr path; }; | 95 | root = mkOption { type = nullOr path; }; |
96 | extraConfig = mkOption { type = listOf lines; default = []; }; | 96 | extraConfig = mkOption { type = listOf lines; default = []; }; |
97 | }; | 97 | }; |
@@ -102,25 +102,25 @@ in | |||
102 | description = "List of vhosts to define for Apache"; | 102 | description = "List of vhosts to define for Apache"; |
103 | type = attrsOf (submodule { | 103 | type = attrsOf (submodule { |
104 | options = { | 104 | options = { |
105 | certName = mkOption { type = string; }; | 105 | certName = mkOption { type = str; }; |
106 | addToCerts = mkOption { | 106 | addToCerts = mkOption { |
107 | type = bool; | 107 | type = bool; |
108 | default = false; | 108 | default = false; |
109 | description = "Use these to certificates. Is ignored (considered true) if certMainHost is not null"; | 109 | description = "Use these to certificates. Is ignored (considered true) if certMainHost is not null"; |
110 | }; | 110 | }; |
111 | certMainHost = mkOption { | 111 | certMainHost = mkOption { |
112 | type = nullOr string; | 112 | type = nullOr str; |
113 | description = "Use that host as 'main host' for acme certs"; | 113 | description = "Use that host as 'main host' for acme certs"; |
114 | default = null; | 114 | default = null; |
115 | }; | 115 | }; |
116 | hosts = mkOption { type = listOf string; }; | 116 | hosts = mkOption { type = listOf str; }; |
117 | root = mkOption { type = nullOr path; }; | 117 | root = mkOption { type = nullOr path; }; |
118 | extraConfig = mkOption { type = listOf lines; default = []; }; | 118 | extraConfig = mkOption { type = listOf lines; default = []; }; |
119 | }; | 119 | }; |
120 | }); | 120 | }); |
121 | }; | 121 | }; |
122 | watchPaths = mkOption { | 122 | watchPaths = mkOption { |
123 | type = listOf string; | 123 | type = listOf str; |
124 | default = []; | 124 | default = []; |
125 | description = '' | 125 | description = '' |
126 | Paths to watch that should trigger a reload of httpd | 126 | Paths to watch that should trigger a reload of httpd |
@@ -178,9 +178,9 @@ in | |||
178 | }; | 178 | }; |
179 | toVhost = ips: vhostConf: { | 179 | toVhost = ips: vhostConf: { |
180 | enableSSL = true; | 180 | enableSSL = true; |
181 | sslServerCert = "${config.security.acme2.certs."${vhostConf.certName}".directory}/cert.pem"; | 181 | sslServerCert = "${config.security.acme.certs."${vhostConf.certName}".directory}/cert.pem"; |
182 | sslServerKey = "${config.security.acme2.certs."${vhostConf.certName}".directory}/key.pem"; | 182 | sslServerKey = "${config.security.acme.certs."${vhostConf.certName}".directory}/key.pem"; |
183 | sslServerChain = "${config.security.acme2.certs."${vhostConf.certName}".directory}/chain.pem"; | 183 | sslServerChain = "${config.security.acme.certs."${vhostConf.certName}".directory}/chain.pem"; |
184 | logFormat = "combinedVhost"; | 184 | logFormat = "combinedVhost"; |
185 | listen = map (ip: { inherit ip; port = 443; }) ips; | 185 | listen = map (ip: { inherit ip; port = 443; }) ips; |
186 | hostName = builtins.head vhostConf.hosts; | 186 | hostName = builtins.head vhostConf.hosts; |
@@ -231,7 +231,7 @@ in | |||
231 | } | 231 | } |
232 | ) cfg.env; | 232 | ) cfg.env; |
233 | 233 | ||
234 | config.security.acme2.certs = let | 234 | config.security.acme.certs = let |
235 | typesToManage = attrsets.filterAttrs (k: v: v.enable) cfg.env; | 235 | typesToManage = attrsets.filterAttrs (k: v: v.enable) cfg.env; |
236 | flatVhosts = lists.flatten (attrsets.mapAttrsToList (k: v: | 236 | flatVhosts = lists.flatten (attrsets.mapAttrsToList (k: v: |
237 | attrValues v.vhostConfs | 237 | attrValues v.vhostConfs |