summaryrefslogtreecommitdiffstats
path: root/makefu
diff options
context:
space:
mode:
authorjeschli <jeschli@gmail.com>2018-03-13 18:52:07 +0100
committerjeschli <jeschli@gmail.com>2018-03-13 18:55:44 +0100
commit6267aa42509a4f56dc95dfc2db7773c33ca12522 (patch)
tree3d9bcb9e7424ebdd04bf8ddcaf96f11626ea351b /makefu
parente7ac3fc703929cd503bc6a01cad449a5b2c328f2 (diff)
parent02f67eed443ba552d775d1a0ab7860d439f7552b (diff)
Merge remote-tracking branch 'origin/master' into HEAD
Diffstat (limited to 'makefu')
-rw-r--r--makefu/2configs/deployment/owncloud.nix50
-rw-r--r--makefu/source.nix6
2 files changed, 51 insertions, 5 deletions
diff --git a/makefu/2configs/deployment/owncloud.nix b/makefu/2configs/deployment/owncloud.nix
index 3a9d57dbb..e9d4b18e0 100644
--- a/makefu/2configs/deployment/owncloud.nix
+++ b/makefu/2configs/deployment/owncloud.nix
@@ -1,6 +1,18 @@
{ lib, pkgs, config, ... }:
with lib;
+# imperative in config.php:
+# #local memcache:
+# 'memcache.local' => '\\OC\\Memcache\\APCu',
+# #local locking:
+# 'memcache.locking' => '\\OC\\Memcache\\Redis',
+# 'redis' =>
+# array (
+# 'host' => 'localhost',
+# 'port' => 6379,
+# ),
+
+
let
# TODO: copy-paste from lass/2/websites/util.nix
serveCloud = domains:
@@ -124,20 +136,48 @@ let
env[PATH] = ${lib.makeBinPath [ pkgs.php ]}
catch_workers_output = yes
'';
+ services.phpfpm.phpOptions = ''
+ opcache.enable=1
+ opcache.enable_cli=1
+ opcache.interned_strings_buffer=8
+ opcache.max_accelerated_files=10000
+ opcache.memory_consumption=128
+ opcache.save_comments=1
+ opcache.revalidate_freq=1
+
+ display_errors = on
+ display_startup_errors = on
+ always_populate_raw_post_data = -1
+ error_reporting = E_ALL | E_STRICT
+ html_errors = On
+ date.timezone = "Europe/Berlin"
+ # extension=${pkgs.phpPackages.memcached}/lib/php/extensions/memcached.so
+ extension=${pkgs.phpPackages.redis}/lib/php/extensions/redis.so
+ extension=${pkgs.phpPackages.apcu}/lib/php/extensions/apcu.so
+ '';
};
in {
imports = [
( serveCloud [ "o.euer.krebsco.de" ] )
];
- services.mysql = { # TODO: currently nextcloud uses sqlite
+ services.redis.enable = true;
+ services.mysql = {
enable = false;
package = pkgs.mariadb;
rootPassword = config.krebs.secret.files.mysql_rootPassword.path;
- };
- services.mysqlBackup = {
- enable = false;
- databases = [ "nextcloud" ];
+ initialDatabases = [
+ # Or use writeText instead of literalExample?
+ #{ name = "nextcloud"; schema = literalExample "./nextcloud.sql"; }
+ {
+ name = "nextcloud";
+ schema = pkgs.writeText "nextcloud.sql"
+ ''
+ create user if not exists 'nextcloud'@'localhost' identified by 'password';
+ grant all privileges on nextcloud.* to 'nextcloud'@'localhost' identified by 'password';
+ '';
+ }
+ ];
};
# dataDir is only defined after mysql is enabled
# krebs.secret.files.mysql_rootPassword = {
diff --git a/makefu/source.nix b/makefu/source.nix
index 708f0d20c..79a2c535f 100644
--- a/makefu/source.nix
+++ b/makefu/source.nix
@@ -13,6 +13,11 @@ let
then "buildbot"
else "makefu";
_file = <stockholm> + "/makefu/1systems/${name}/source.nix";
+ pkgs = import <nixpkgs> {
+ overlays = map import [
+ <stockholm/krebs/5pkgs>
+ ];
+ };
# TODO: automate updating of this ref + cherry-picks
ref = "51810e0"; # nixos-17.09 @ 2018-02-14
# + do_sqlite3 ruby: 55a952be5b5
@@ -42,6 +47,7 @@ in
};
stockholm.file = toString <stockholm>;
+ stockholm-version.pipe = "${pkgs.stockholm}/bin/get-version";
}
(mkIf ( musnix ) {
musnix.git = {