2023-04-04 22:56:30 -07:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
services.nextcloud = {
|
|
|
|
enable = true;
|
2023-06-18 14:47:22 -07:00
|
|
|
package = pkgs.nextcloud27;
|
2023-08-28 17:21:53 -07:00
|
|
|
enableImagemagick = true;
|
2023-04-10 20:23:37 -07:00
|
|
|
nginx.recommendedHttpHeaders = true;
|
2023-04-07 16:50:38 -07:00
|
|
|
https = true;
|
2023-04-10 20:23:37 -07:00
|
|
|
hostName = "files.nickiel.net";
|
2023-04-05 21:10:58 -07:00
|
|
|
home = "/Aurora/nextcloud";
|
|
|
|
|
2023-04-10 20:23:37 -07:00
|
|
|
autoUpdateApps.enable = true;
|
2023-04-04 22:56:30 -07:00
|
|
|
|
2023-08-28 17:21:53 -07:00
|
|
|
extraOptions = {
|
|
|
|
preview_max_x = 2048;
|
|
|
|
preview_max_y = 2048;
|
|
|
|
jpeg_quality = 50;
|
|
|
|
enable_previews = true;
|
|
|
|
enabledPreviewProviders = [
|
|
|
|
"OC\\Preview\\HEIC"
|
2023-09-09 18:13:26 -07:00
|
|
|
"OC\\Preview\\JPEG"
|
|
|
|
"OC\\Preview\\JPG"
|
|
|
|
"OC\\Preview\\PNG"
|
2023-11-16 15:46:15 -08:00
|
|
|
"OC\\Preview\\MP4"
|
|
|
|
"OC\\Preview\\MOVIE"
|
2023-08-28 17:21:53 -07:00
|
|
|
];
|
|
|
|
};
|
|
|
|
|
2023-05-06 11:05:23 -07:00
|
|
|
database.createLocally = false;
|
2023-04-04 22:56:30 -07:00
|
|
|
config = {
|
2023-05-06 09:39:03 -07:00
|
|
|
defaultPhoneRegion = "US";
|
2023-04-07 16:50:38 -07:00
|
|
|
overwriteProtocol = "https";
|
2023-04-04 22:56:30 -07:00
|
|
|
extraTrustedDomains = [
|
2023-04-08 10:48:21 -07:00
|
|
|
"10.0.0.183"
|
2023-04-07 16:50:38 -07:00
|
|
|
"files.nickiel.net"
|
2023-04-04 22:56:30 -07:00
|
|
|
];
|
2023-04-10 20:23:37 -07:00
|
|
|
trustedProxies = [
|
|
|
|
"files.nickiel.net"
|
|
|
|
];
|
2023-04-05 21:10:58 -07:00
|
|
|
|
|
|
|
dbtype = "pgsql";
|
|
|
|
dbuser = "nextcloud";
|
|
|
|
dbhost = "/run/postgresql";
|
|
|
|
dbname = "nextcloud";
|
2023-05-06 11:04:25 -07:00
|
|
|
#dbpassFile = "/Aurora/nextcloud/nextcloud-db-password";
|
2023-04-05 21:10:58 -07:00
|
|
|
|
|
|
|
# This doesn't seem to be working, see this documation:
|
|
|
|
# https://docs.nextcloud.com/server/latest/admin_manual/configuration_user/reset_admin_password.html
|
|
|
|
adminpassFile = "/Aurora/nextcloud/nextcloud-admin-password";
|
|
|
|
adminuser = "admin";
|
2023-04-04 22:56:30 -07:00
|
|
|
};
|
2023-04-05 21:10:58 -07:00
|
|
|
};
|
2023-04-04 22:56:30 -07:00
|
|
|
|
2023-04-05 21:10:58 -07:00
|
|
|
services.postgresql = {
|
|
|
|
enable = true;
|
2023-05-27 15:49:25 -07:00
|
|
|
enableTCPIP = true;
|
2023-04-05 21:10:58 -07:00
|
|
|
ensureDatabases = [ "nextcloud" ];
|
|
|
|
ensureUsers = [
|
|
|
|
{
|
|
|
|
name = "nextcloud";
|
2023-12-17 19:24:49 -08:00
|
|
|
ensureDBOwnership = true;
|
2023-04-05 21:10:58 -07:00
|
|
|
}
|
|
|
|
];
|
|
|
|
authentication = lib.mkForce ''
|
|
|
|
# TYPE DATABASE USER ADDRESS METHOD
|
|
|
|
local all all trust
|
|
|
|
host all all 127.0.0.1/32 trust
|
|
|
|
host all all ::1/128 trust
|
2023-05-27 15:49:25 -07:00
|
|
|
host all all 0.0.0.0/0 md5
|
|
|
|
''; # address is the computer you are connecting from
|
2023-04-05 21:10:58 -07:00
|
|
|
};
|
2023-04-04 22:56:30 -07:00
|
|
|
|
2023-04-05 21:10:58 -07:00
|
|
|
# Make sure PostSQL is running before nextcloud
|
|
|
|
systemd.services."nextcloud-setup" = {
|
|
|
|
requires = ["postgresql.service"];
|
|
|
|
after = ["postgresql.service"];
|
2023-04-04 22:56:30 -07:00
|
|
|
};
|
2023-11-15 21:27:02 -08:00
|
|
|
|
|
|
|
systemd.services.nextcloud-preview = {
|
|
|
|
description = "Generate previews for all images that haven't been rendered";
|
|
|
|
path = with pkgs; [
|
|
|
|
config.services.nextcloud.occ
|
|
|
|
];
|
|
|
|
script = ''
|
|
|
|
nextcloud-occ preview:pre-generate
|
|
|
|
'';
|
|
|
|
startAt = "01:00:00";
|
|
|
|
};
|
2023-04-04 22:56:30 -07:00
|
|
|
}
|