nicks-nix-config/hosts/Alaska/modules/nextcloud.nix

79 lines
1.9 KiB
Nix
Raw Normal View History

2023-04-04 22:56:30 -07:00
{ config, lib, pkgs, ... }:
{
2024-07-11 18:30:41 -07:00
services.nextcloud = {
enable = true;
2024-10-09 16:39:04 -07:00
package = pkgs.nextcloud30;
2024-07-11 18:30:41 -07:00
enableImagemagick = true;
nginx.recommendedHttpHeaders = true;
https = true;
hostName = "files.nickiel.net";
home = "/Aurora/nextcloud";
2023-04-05 21:10:58 -07:00
2024-07-11 18:30:41 -07:00
autoUpdateApps.enable = true;
2023-04-04 22:56:30 -07:00
2024-07-11 18:30:41 -07:00
phpOptions = {
"opcache.interned_strings_buffer" = "64";
};
2024-04-13 16:52:04 -07:00
2024-07-11 18:30:41 -07:00
settings = {
preview_max_x = 2048;
preview_max_y = 2048;
jpeg_quality = 50;
enable_previews = true;
enabledPreviewProviders = [
"OC\\Preview\\HEIC"
"OC\\Preview\\JPEG"
"OC\\Preview\\JPG"
"OC\\Preview\\PNG"
"OC\\Preview\\MP4"
"OC\\Preview\\MOVIE"
];
2024-04-13 16:52:04 -07:00
2024-07-11 18:30:41 -07:00
log_type = "file";
maintenance_window_start = "10"; # 3 AM PDT
2024-04-13 16:52:04 -07:00
2024-07-11 18:30:41 -07:00
default_phone_region = "US";
overwriteProtocol = "https";
extraTrustedDomains = [
"10.0.0.183"
"files.nickiel.net"
];
trustedProxies = [
"files.nickiel.net"
];
};
2023-08-28 17:21:53 -07:00
2024-07-11 18:30:41 -07:00
database.createLocally = false;
config = {
dbtype = "pgsql";
dbuser = "nextcloud";
dbhost = "/run/postgresql";
dbname = "nextcloud";
#dbpassFile = "/Aurora/nextcloud/nextcloud-db-password";
2023-04-05 21:10:58 -07:00
2024-07-11 18:30:41 -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
2024-07-11 18:30:41 -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
2024-07-11 18:30:41 -07: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
}