From 02532d72115920973c5925abf974848ee3d90f5e Mon Sep 17 00:00:00 2001 From: Alexander Bantyev Date: Fri, 31 Jul 2020 21:00:51 +0300 Subject: [PATCH] Separate nextcloud --- modules/default.nix | 1 + modules/nextcloud.nix | 18 ++++++++++++++++++ modules/services.nix | 4 +++- 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 modules/nextcloud.nix diff --git a/modules/default.nix b/modules/default.nix index 03c6501..a983377 100755 --- a/modules/default.nix +++ b/modules/default.nix @@ -35,6 +35,7 @@ device: ./power.nix ./network.nix ] ++ lib.optionals (device == "AMD-Workstation") [ + ./nextcloud.nix ./mailserver.nix ./matrix-synapse.nix ./workspace/kanshi.nix diff --git a/modules/nextcloud.nix b/modules/nextcloud.nix new file mode 100644 index 0000000..e75cdee --- /dev/null +++ b/modules/nextcloud.nix @@ -0,0 +1,18 @@ +{ config, pkgs, lib, ... }: +{ + services.nextcloud = { + enable = true; + nginx.enable = true; + hostName = "nextcloud.balsoft.ru"; + config.adminpassFile = "/home/balsoft/nextcloud-admin"; + package = pkgs.nextcloud19; + https = true; + }; + services.nginx.virtualHosts."nextcloud.balsoft.ru" = { + enableACME = true; + forceSSL = true; + locations."/".proxyWebsockets = true; + locations."~ ^\\/(?:build|tests|config|lib|3rdparty|templates|data)\\/".proxyWebsockets = true; + locations."~ ^\\/(?:index|remote|public|cron|core/ajax\\/update|status|ocs\\/v[12]|updater\\/.+|ocs-provider\\/.+|ocm-provider\\/.+)\\.php(?:$|\\/)".proxyWebsockets = true; + }; +} diff --git a/modules/services.nix b/modules/services.nix index c691ccf..7a85cdf 100644 --- a/modules/services.nix +++ b/modules/services.nix @@ -51,7 +51,7 @@ networking.firewall.trustedInterfaces = [ "eth0" ]; services.nextcloud = { - enable = true; + enable = config.device == "AMD-Workstation"; nginx.enable = true; hostName = "nextcloud.balsoft.ru"; config.adminpassFile = "/home/balsoft/nextcloud-admin"; @@ -59,6 +59,8 @@ https = true; }; + services.nginx.enable = config.device == "AMD-Workstation"; + services.nginx.virtualHosts."nextcloud.balsoft.ru" = { enableACME = true; forceSSL = true;