diff options
author | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-05-16 23:23:05 +0200 |
---|---|---|
committer | Ismaël Bouya <ismael.bouya@normalesup.org> | 2019-05-17 00:04:47 +0200 |
commit | 7df420c27ebe7daaa4fd099c457ce9a9075b840e (patch) | |
tree | ec41e01e9331652c09dc4f2ed4186ce5952c3882 /nixops/modules/websites/capitaines | |
parent | 52f45eb051df228955add90ca62de66a7ed8af34 (diff) | |
download | Nix-7df420c27ebe7daaa4fd099c457ce9a9075b840e.tar.gz Nix-7df420c27ebe7daaa4fd099c457ce9a9075b840e.tar.zst Nix-7df420c27ebe7daaa4fd099c457ce9a9075b840e.zip |
Add certificate creation and handling to websites
Diffstat (limited to 'nixops/modules/websites/capitaines')
-rw-r--r-- | nixops/modules/websites/capitaines/default.nix | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/nixops/modules/websites/capitaines/default.nix b/nixops/modules/websites/capitaines/default.nix index 0d85266..4bbf488 100644 --- a/nixops/modules/websites/capitaines/default.nix +++ b/nixops/modules/websites/capitaines/default.nix | |||
@@ -13,20 +13,17 @@ in { | |||
13 | }; | 13 | }; |
14 | 14 | ||
15 | config = lib.mkIf cfg.production.enable { | 15 | config = lib.mkIf cfg.production.enable { |
16 | security.acme.certs."capitaines" = config.services.myCertificates.certConfig // { | ||
17 | domain = "mastodon.capitaines.fr"; | ||
18 | extraDomains = { "capitaines.fr" = null; }; | ||
19 | }; | ||
20 | system.extraSystemBuilderCmds = '' | 16 | system.extraSystemBuilderCmds = '' |
21 | mkdir -p $out/webapps | 17 | mkdir -p $out/webapps |
22 | ln -s ${siteDir} $out/webapps/${webappName} | 18 | ln -s ${siteDir} $out/webapps/${webappName} |
23 | ''; | 19 | ''; |
24 | 20 | ||
25 | services.websites.production.vhostConfs.capitaines_mastodon = { | 21 | services.websites.production.vhostConfs.capitaines_mastodon = { |
26 | certName = "capitaines"; | 22 | certName = "capitaines"; |
27 | hosts = [ "mastodon.capitaines.fr" ]; | 23 | certMainHost = "mastodon.capitaines.fr"; |
28 | root = root; | 24 | hosts = [ "mastodon.capitaines.fr" ]; |
29 | extraConfig = [ | 25 | root = root; |
26 | extraConfig = [ | ||
30 | '' | 27 | '' |
31 | ErrorDocument 404 /index.html | 28 | ErrorDocument 404 /index.html |
32 | <Directory ${root}> | 29 | <Directory ${root}> |
@@ -39,9 +36,10 @@ in { | |||
39 | }; | 36 | }; |
40 | 37 | ||
41 | services.websites.production.vhostConfs.capitaines = { | 38 | services.websites.production.vhostConfs.capitaines = { |
42 | certName = "capitaines"; | 39 | certName = "capitaines"; |
43 | hosts = [ "capitaines.fr" ]; | 40 | addToCerts = true; |
44 | root = "/run/current-system/webapps/_www"; | 41 | hosts = [ "capitaines.fr" ]; |
42 | root = "/run/current-system/webapps/_www"; | ||
45 | extraConfig = [ '' | 43 | extraConfig = [ '' |
46 | <Directory /run/current-system/webapps/_www> | 44 | <Directory /run/current-system/webapps/_www> |
47 | DirectoryIndex index.htm | 45 | DirectoryIndex index.htm |