blob: c24f8db45a00b0b95e8d8614d113491f2028cf0e (
plain) (
tree)
|
|
{ lib, pkgs, config, myconfig, mylibs, ... }:
let
infcloud = rec {
webappName = "tools_infcloud";
root = "/run/current-system/webapps/${webappName}";
vhostConf = ''
Alias /carddavmate ${root}
Alias /caldavzap ${root}
Alias /infcloud ${root}
<Directory ${root}>
AllowOverride All
Options FollowSymlinks
Require all granted
DirectoryIndex index.html
</Directory>
'';
};
davical = pkgs.callPackage ./davical.nix {
env = myconfig.env.tools.davical;
inherit (pkgs.webapps) davical awl;
};
cfg = config.services.myWebsites.tools.dav;
in {
options.services.myWebsites.tools.dav = {
enable = lib.mkEnableOption "enable dav website";
};
config = lib.mkIf cfg.enable {
security.acme.certs."eldiron".extraDomains."dav.immae.eu" = null;
mySecrets.keys = davical.keys;
services.myWebsites.tools.modules = davical.apache.modules;
services.myWebsites.tools.vhostConfs.dav = {
certName = "eldiron";
hosts = ["dav.immae.eu" ];
root = null;
extraConfig = [
infcloud.vhostConf
davical.apache.vhostConf
];
};
services.myPhpfpm.poolConfigs = {
davical = davical.phpFpm.pool;
};
system.extraSystemBuilderCmds = ''
mkdir -p $out/webapps
ln -s ${davical.webRoot} $out/webapps/${davical.apache.webappName}
ln -s ${pkgs.webapps.infcloud} $out/webapps/${infcloud.webappName}
'';
};
}
|