blob: 241b98251debab4c09b6d6ad9d34bb21c908a3cd (
plain) (
tree)
|
|
{ lib, pkgs, config, myconfig, mylibs, ... }:
let
nextcloud = pkgs.callPackage ./nextcloud.nix {
env = myconfig.env.tools.nextcloud;
};
cfg = config.services.myWebsites.tools.cloud;
in {
options.services.myWebsites.tools.cloud = {
enable = lib.mkEnableOption "enable cloud website";
};
config = lib.mkIf cfg.enable {
security.acme.certs."eldiron".extraDomains."cloud.immae.eu" = null;
services.myWebsites.tools.modules = nextcloud.apache.modules;
services.myWebsites.tools.vhostConfs.cloud = {
certName = "eldiron";
hosts = ["cloud.immae.eu" ];
root = nextcloud.webRoot;
extraConfig = [
nextcloud.apache.vhostConf
];
};
environment.systemPackages = let
occ = pkgs.writeScriptBin "nextcloud-occ" ''
#! ${pkgs.stdenv.shell}
cd ${nextcloud.webRoot}
NEXTCLOUD_CONFIG_DIR="${nextcloud.webRoot}/config" \
exec \
${pkgs.php}/bin/php \
-c ${pkgs.php}/etc/php.ini \
occ $*
'';
in [ occ ];
system.activationScripts.nextcloud = nextcloud.activationScript;
services.myPhpfpm = {
poolPhpConfigs.nextcloud = nextcloud.phpFpm.phpConfig;
poolConfigs.nextcloud = nextcloud.phpFpm.pool;
};
};
}
|