blob: 0dc27bc195c535b1e7480409d39d19341e623116 [file] [log] [blame]
Skyler Grey09c5cda2023-10-09 07:10:10 +00001{config, pkgs, lib, ...}: {
2 sops.secrets.clicks_nextcloud_db_password = {
3 mode = lib.mkForce "0440";
4 group = lib.mkForce "nextcloud";
5 };
6
7 users.users.nextcloud = {
8 isSystemUser = true;
9 createHome = true;
10 home = "/var/lib/nextcloud";
11 group = config.users.groups.nextcloud.name;
12 shell = pkgs.bashInteractive;
13 };
14 users.groups.nextcloud = {};
15
16
17 services.nextcloud.enable = true;
18 services.nextcloud.config.adminpassFile = config.sops.secrets.nextcloud_admin_password.path;
19 services.nextcloud.hostName = "cloud.clicks.codes";
20 services.nextcloud.package = pkgs.nextcloud27;
21 services.nextcloud.poolSettings = {
22 pm = "dynamic";
23 "pm.max_children" = "32";
24 "pm.max_requests" = "500";
25 "pm.max_spare_servers" = "4";
26 "pm.min_spare_servers" = "2";
27 "pm.start_servers" = "2";
28 "listen.owner" = config.users.users.nextcloud.name;
29 "listen.group" = config.users.users.nextcloud.group;
30 };
31
32 services.nextcloud.config = {
33 dbtype = "pgsql";
34 dbport = config.services.postgresql.port;
35 dbpassFile = config.sops.secrets.clicks_nextcloud_db_password.path;
36 dbname = "nextcloud";
37 dbhost = "localhost";
38 extraTrustedDomains = [ "nextcloud.clicks.codes" "docs.clicks.codes" ];
39 };
40
Skyler Grey9ae213d2023-10-10 23:43:29 +000041 services.nextcloud.extraConfig = {
42 social_login_auto_redirect = true;
43 };
44
Skyler Grey13420dc2023-10-10 22:23:26 +000045 services.nextcloud.extraApps = {
46 sociallogin = pkgs.fetchNextcloudApp {
47 url = "https://github.com/zorn-v/nextcloud-social-login/releases/download/v5.5.3/release.tar.gz";
48 sha256 = "sha256-96/wtK7t23fXVRcntDONjgb5bYtZuaNZzbvQCa5Gsj4=";
49 };
50 };
51
Skyler Grey09c5cda2023-10-09 07:10:10 +000052 sops.secrets.nextcloud_admin_password = {
53 mode = "0600";
54 owner = config.users.users.nextcloud.name;
55 group = config.users.users.nextcloud.group;
56 sopsFile = ../secrets/nextcloud.json;
57 format = "json";
58 };
Skyler Grey13420dc2023-10-10 22:23:26 +000059}