From 4c1126b91eafb8229a9331316ef6a192e337a2e7 Mon Sep 17 00:00:00 2001 From: 514fpv Date: Sat, 27 Jan 2024 09:56:24 +0800 Subject: [PATCH] feat(focus): enable nextcloud --- spec/focus/nextcloud.nix | 42 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 spec/focus/nextcloud.nix diff --git a/spec/focus/nextcloud.nix b/spec/focus/nextcloud.nix new file mode 100644 index 00000000..94f32236 --- /dev/null +++ b/spec/focus/nextcloud.nix @@ -0,0 +1,42 @@ +{ pkgs +, ...}: let + host = "cloud.sf.514fpv.io"; +in { + services.nextcloud = { + enable = true; + package = pkgs.nextcloud28; + extraApps = { + inherit (pkgs.nextcloud28Packages.apps) + notify_push impersonate spreed + contacts bookmarks deck polls notes forms; + }; + home = "/nix/persist/service/nextcloud"; + configureRedis = true; + webfinger = true; + maxUploadSize = "128G"; + hostName = host; + phpExtraExtensions = all: with all; [ bz2 ]; + database.createLocally = true; + config.dbtype = "pgsql"; + config.adminuser = "koishi"; + config.adminpassFile = builtins.toString (pkgs.writeText "password" "initial_password"); + extraOptions.overwriteprotocol = "https"; + extraOptions.default_phone_region = "US"; + caching.redis = true; + phpOptions.upload_max_filesize = "128G"; + phpOptions.post_max_size = "128G"; + phpOptions.output_buffering = "0"; + phpOptions."opcache.interned_strings_buffer" = "32"; + https = true; + }; + + users.users.nextcloud.uid = 1022; + users.groups.nextcloud.gid = 1022; + + services.nginx.virtualHosts.${host} = { + useACMEHost = ".sf.514fpv.io"; + addSSL = true; + }; + + global.fs.zfs.mountpoints."/nix/persist/service/nextcloud" = "service/nextcloud"; +}