blob: 360d52c5ae97396d68fe95c8975ed35ce6e44e07 (
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.apache.root;
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 \
sudo -u wwwrun ${pkgs.php}/bin/php \
-c ${pkgs.php}/etc/php.ini \
occ $*
'';
in [ occ ];
system.activationScripts.nextcloud = nextcloud.activationScript;
system.extraSystemBuilderCmds = ''
mkdir -p $out/webapps
ln -s ${nextcloud.webRoot} $out/webapps/${nextcloud.apache.webappName}
'';
services.myPhpfpm = {
poolPhpConfigs.nextcloud = nextcloud.phpFpm.phpConfig;
poolConfigs.nextcloud = nextcloud.phpFpm.pool;
};
services.cron = {
enable = true;
systemCronJobs = [
''
LOCALE_ARCHIVE=/run/current-system/sw/lib/locale/locale-archive
*/15 * * * * wwwrun ${pkgs.php}/bin/php -f ${nextcloud.webRoot}/cron.php
''
];
};
};
}
|