From 910f5a493f4dcab74f9328f63fef681d667fcafa Mon Sep 17 00:00:00 2001 From: Jonas Heinrich Date: Thu, 30 Mar 2023 18:13:12 +0200 Subject: [PATCH] update and fix issues --- Makefile | 1 + calendar | 2 +- flake.lock | 12 ++++----- server | 2 +- vm-nextcloud.nix | 63 ++++++++++++++++++++++++++++++++++++++---------- 5 files changed, 59 insertions(+), 21 deletions(-) diff --git a/Makefile b/Makefile index 342c94e..92100ec 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,7 @@ build: # config ⇒ /var/lib/nextcloud/config # FIXME cd calendar && make dev-setup cd calendar && make build-js + cd calendar && make composer-init clean: rm nixos.qcow2 \ No newline at end of file diff --git a/calendar b/calendar index 60ddbc1..28af040 160000 --- a/calendar +++ b/calendar @@ -1 +1 @@ -Subproject commit 60ddbc10f913fd2d055a11b5476734bac0f20858 +Subproject commit 28af040e4bd209397e04df7d617c7b1044bd9423 diff --git a/flake.lock b/flake.lock index 012aa0a..8b6ffbf 100644 --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "flake-utils": { "locked": { - "lastModified": 1676283394, - "narHash": "sha256-XX2f9c3iySLCw54rJ/CZs+ZK6IQy7GXNY4nSOyu2QG4=", + "lastModified": 1678901627, + "narHash": "sha256-U02riOqrKKzwjsxc/400XnElV+UtPUQWpANPlyazjH0=", "owner": "numtide", "repo": "flake-utils", - "rev": "3db36a8b464d0c4532ba1c7dda728f4576d6d073", + "rev": "93a2b84fc4b70d9e089d029deacc3583435c2ed6", "type": "github" }, "original": { @@ -17,11 +17,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1676898135, - "narHash": "sha256-PyYBbRhl6YoN1ApIIzs9sBL3HNt5pYiKKkr/7OZDH5w=", + "lastModified": 1677066544, + "narHash": "sha256-pSJtrp47JsALG6aYl0rlKbMe1vy/x8t1So6CsmGn6po=", "owner": "onny", "repo": "nixpkgs", - "rev": "6a64e05f6e2894df5cff91eab1a6a38a311e4f24", + "rev": "5e489eee1b85503960fc8496d5e27593a7eca6fd", "type": "github" }, "original": { diff --git a/server b/server index 95eeba8..c0cddec 160000 --- a/server +++ b/server @@ -1 +1 @@ -Subproject commit 95eeba83b6570b3cf7cbb79aea42222f7d3e03f4 +Subproject commit c0cddec224ee561152c918c31a91c98e5958621c diff --git a/vm-nextcloud.nix b/vm-nextcloud.nix index e660bd6..3dde283 100644 --- a/vm-nextcloud.nix +++ b/vm-nextcloud.nix @@ -4,6 +4,11 @@ { pkgs, config, lib, options, ... }: { + virtualisation = { + memorySize = 8000; + cores = 4; + }; + # FIXME disabledModules = [ "services/web-apps/nextcloud.nix" @@ -19,7 +24,7 @@ (self: super: { # Remove first run wizard and password policy check from Nextcloud # package - nextcloud25 = super.nextcloud25.overrideAttrs (oldAttrs: rec { + nextcloud26 = super.nextcloud26.overrideAttrs (oldAttrs: rec { patches = []; src = ./server; installPhase = oldAttrs.installPhase + '' @@ -37,17 +42,16 @@ # Setup Nextcloud including apps services.nextcloud = { enable = true; - package = pkgs.nextcloud25; + package = pkgs.nextcloud26; hostName = "localhost"; - extraApps = with pkgs.nextcloud25Packages.apps; { - inherit calendar; - }; + #extraApps = with pkgs.nextcloud26Packages.apps; { + # inherit calendar; + #}; extraAppsEnable = true; config = { adminuser = "admin"; adminpassFile = "${pkgs.writeText "adminpass" "test123"}"; }; - caching.apcu = false; phpPackage = lib.mkForce (pkgs.php.buildEnv { extensions = ({ enabled, all }: enabled ++ (with all; [ xdebug @@ -61,12 +65,41 @@ "xdebug.idekey" = "ECLIPSE"; }; appstoreEnable = false; + caching = { + redis = true; + apcu = false; + }; extraOptions = { mail_smtpmode = "sendmail"; mail_sendmailmode = "pipe"; debug = true; logLevel = 0; trusted_domains = [ "10.100.100.1" ]; + redis = { + host = "/run/redis-nextcloud/redis.sock"; + port = 0; + }; + memcache = { + local = "\\OC\\Memcache\\Redis"; + distributed = "\\OC\\Memcache\\Redis"; + locking = "\\OC\\Memcache\\Redis"; + }; + phpOptions = { + short_open_tag = "Off"; + expose_php = "Off"; + error_reporting = "E_ALL & ~E_DEPRECATED & ~E_STRICT"; + display_errors = "stderr"; + "opcache.enable_cli" = "1"; + "opcache.enable" = "1"; + "opcache.interned_strings_buffer" = "12"; + "opcache.max_accelerated_files" = "10000"; + "opcache.memory_consumption" = "128"; + "opcache.save_comments" = "1"; + "opcache.revalidate_freq" = "1"; + "opcache.fast_shutdown" = "1"; + "openssl.cafile" = "/etc/ssl/certs/ca-certificates.crt"; + catch_workers_output = "yes"; + }; apps_paths = [ { path = "/var/lib/nextcloud/nix-apps"; @@ -87,24 +120,28 @@ target = ./server; cache = "none"; }; - # FIXME - #"/var/lib/nextcloud/server/apps/calendar" = { - # target = ./calendar; - # cache = "none"; - #}; + "/var/lib/nextcloud/server/apps/calendar" = { + target = ./calendar; + cache = "none"; + }; "/var/lib/nextcloud/server/3rdparty/sabre/dav" = { target = ./dav; cache = "none"; }; }; services.nginx.virtualHosts."localhost".root = lib.mkForce "/var/lib/nextcloud/server"; + services.redis.servers.nextcloud = { + enable = true; + user = "nextcloud"; + port = 0; + }; # Setup mail server services.maddy = { enable = true; hostname = "localhost"; primaryDomain = "localhost"; - localDomains = [ "$(primary_domain)" "10.100.100.1" ]; + localDomains = [ "$(primary_domain)" "10.0.2.0/24" "127.0.0.1" ]; # Disable any sender validation checks config = lib.concatStrings ( builtins.match "(.*)authorize_sender.*identity\n[ ]+\}(.*)" options.services.maddy.config.default @@ -178,7 +215,7 @@ }; # Required for php unit testing - environment.systemPackages = [ pkgs.php ]; + environment.systemPackages = with pkgs; [ php sqlite htop ]; # FIXME Package phpunit? # Inside /var/lib/nextcloud/server run # composer require phpunit/phpunit