-{ lib, pkgs, config, myconfig, ... }:
+{ lib, pkgs, config, ... }:
let
chloe = pkgs.callPackage ./builder.nix {
inherit (pkgs.webapps) chloe;
- config = myconfig.env.websites.chloe.production;
+ config = config.myEnv.websites.chloe.production;
apacheUser = config.services.httpd.Prod.user;
apacheGroup = config.services.httpd.Prod.group;
};
options.myServices.websites.chloe.production.enable = lib.mkEnableOption "enable Chloe's website in production";
config = lib.mkIf cfg.enable {
- services.backup.profiles.chloe_prod.rootDir = chloe.app.varDir;
+ services.duplyBackup.profiles.chloe_prod.rootDir = chloe.app.varDir;
secrets.keys = chloe.keys;
services.webstats.sites = [ { name = "osteopathe-cc.fr"; } ];
certMainHost = "osteopathe-cc.fr";
hosts = ["osteopathe-cc.fr" "www.osteopathe-cc.fr" ];
root = chloe.apache.root;
- extraConfig = [ chloe.apache.vhostConf ];
+ extraConfig = [
+ ''
+ RewriteEngine On
+ RewriteCond "%{HTTP_HOST}" "!^www\.osteopathe-cc\.fr$" [NC]
+ RewriteRule ^(.+)$ https://www.osteopathe-cc.fr$1 [R=302,L]
+ ''
+ chloe.apache.vhostConf
+ ];
};
services.websites.env.production.watchPaths = [
"/var/secrets/webapps/${chloe.app.environment}-chloe"