aboutsummaryrefslogblamecommitdiff
path: root/nixops/modules/websites/tools/dav/default.nix
blob: 56b3006edad0449079b6d92f0d5263a222852957 (plain) (tree)
1
2
3
4
5
6
                                             

                                                  


                                              









                                                                     
                                   















                                                               




                                                                          


    
{ lib, pkgs, config, myconfig, mylibs, ... }:
let
    infcloud = pkgs.callPackage ./infcloud.nix {};
    davical = pkgs.callPackage ./davical.nix {
      env = myconfig.env.tools.davical;
    };

    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;

    deployment.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.apache.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 ${infcloud.webRoot} $out/webapps/${infcloud.apache.webappName}
      '';
  };
}