X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=modules%2Fprivate%2Fwebsites%2Fcapitaines%2Fproduction.nix;h=ee1698b0b5aca4f66d960019e58d19cdd6bf122b;hb=5dc338f00bb37519260ffa07f2ccbb80b0abc833;hp=57d878737a42eef9ed0c114990d7d02dae0ce06e;hpb=4288c2f2431fb782b0d512b1b3749187f2374b6a;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/modules/private/websites/capitaines/production.nix b/modules/private/websites/capitaines/production.nix index 57d8787..ee1698b 100644 --- a/modules/private/websites/capitaines/production.nix +++ b/modules/private/websites/capitaines/production.nix @@ -1,17 +1,15 @@ -{ lib, pkgs, config, myconfig, ... }: +{ lib, pkgs, config, ... }: let - cfg = config.myServices.websites.capitaines.production; - env = myconfig.env.websites.capitaines; - webappName = "capitaines_mastodon"; - root = "/run/current-system/webapps/${webappName}"; - siteDir = ./mastodon_static; + cfg = config.myServices.websites.capitaines.production; + env = config.myEnv.websites.capitaines; in { options.myServices.websites.capitaines.production.enable = lib.mkEnableOption "enable Capitaines's website"; config = lib.mkIf cfg.enable { - myServices.websites.webappDirs."${webappName}" = siteDir; - - services.websites.production.vhostConfs.capitaines_mastodon = { + myServices.websites.webappDirs.capitaines_mastodon = ./mastodon_static; + services.websites.env.production.vhostConfs.capitaines_mastodon = let + root = "/run/current-system/webapps/capitaines_mastodon"; + in { certName = "capitaines"; certMainHost = "mastodon.capitaines.fr"; hosts = [ "mastodon.capitaines.fr" ]; @@ -28,7 +26,27 @@ in { ]; }; - services.websites.production.vhostConfs.capitaines = { + myServices.websites.webappDirs.capitaines_discourse = ./discourse_static; + services.websites.env.production.vhostConfs.capitaines_discourse = let + root = "/run/current-system/webapps/capitaines_discourse"; + in { + certName = "capitaines"; + addToCerts = true; + hosts = [ "discourse.capitaines.fr" ]; + root = root; + extraConfig = [ + '' + ErrorDocument 404 /index.html + + DirectoryIndex index.html + Options Indexes FollowSymLinks MultiViews Includes + Require all granted + + '' + ]; + }; + + services.websites.env.production.vhostConfs.capitaines = { certName = "capitaines"; addToCerts = true; hosts = [ "capitaines.fr" ];