blob: 80739556030568c07b9fb11e3d0e06cdfa7f6a4f (
plain) (
tree)
|
|
{ lib, pkgs, config, myconfig, mylibs, ... }:
let
cfg = config.services.myWebsites.Capitaines;
env = myconfig.env.websites.capitaines;
webappName = "capitaines_mastodon";
root = "/run/current-system/webapps/${webappName}";
siteDir = ./mastodon_static;
in {
options.services.myWebsites.Capitaines = {
production = {
enable = lib.mkEnableOption "enable Capitaines's website";
};
};
config = lib.mkIf cfg.production.enable {
security.acme.certs."capitaines_mastodon" = config.services.myCertificates.certConfig // {
domain = "mastodon.capitaines.fr";
};
system.extraSystemBuilderCmds = ''
mkdir -p $out/webapps
ln -s ${siteDir} $out/webapps/${webappName}
'';
services.myWebsites.production.vhostConfs.capitaines = {
certName = "capitaines_mastodon";
hosts = [ "mastodon.capitaines.fr" ];
root = root;
extraConfig = [
''
ErrorDocument 404 /index.html
<Directory ${root}>
DirectoryIndex index.html
Options Indexes FollowSymLinks MultiViews Includes
Require all granted
</Directory>
''
];
};
};
}
|