2022-08-26 10:21:05 +00:00
|
|
|
{ pkgs, lib, config, ... }:
|
2021-11-15 10:02:05 +00:00
|
|
|
let
|
|
|
|
cfg = config.services.userdata;
|
|
|
|
in
|
|
|
|
{
|
2022-08-26 10:21:05 +00:00
|
|
|
fileSystems = lib.mkIf cfg.useBinds {
|
|
|
|
"/var/lib/nextcloud" = {
|
|
|
|
device = "/volumes/${cfg.nextcloud.location}/nextcloud";
|
|
|
|
options = [ "bind" ];
|
|
|
|
};
|
|
|
|
};
|
2021-11-15 10:02:05 +00:00
|
|
|
services.nextcloud = {
|
|
|
|
enable = cfg.nextcloud.enable;
|
2023-03-17 11:38:11 +00:00
|
|
|
package = pkgs.nextcloud25;
|
2021-11-15 10:02:05 +00:00
|
|
|
hostName = "cloud.${cfg.domain}";
|
|
|
|
|
|
|
|
# Use HTTPS for links
|
|
|
|
https = false;
|
|
|
|
|
|
|
|
# Auto-update Nextcloud Apps
|
|
|
|
autoUpdateApps.enable = true;
|
|
|
|
# Set what time makes sense for you
|
|
|
|
autoUpdateApps.startAt = "05:00:00";
|
|
|
|
|
|
|
|
config = {
|
|
|
|
# Further forces Nextcloud to use HTTPS
|
2021-12-06 07:43:24 +00:00
|
|
|
overwriteProtocol = "https";
|
2021-11-15 10:02:05 +00:00
|
|
|
|
|
|
|
# Nextcloud PostegreSQL database configuration, recommended over using SQLite
|
|
|
|
dbtype = "sqlite";
|
|
|
|
dbuser = "nextcloud";
|
|
|
|
dbhost = "/run/postgresql"; # nextcloud will add /.s.PGSQL.5432 by itself
|
|
|
|
dbname = "nextcloud";
|
2021-11-17 08:54:36 +00:00
|
|
|
dbpassFile = "/var/lib/nextcloud/db-pass";
|
2021-11-15 10:02:05 +00:00
|
|
|
|
2021-11-17 08:54:36 +00:00
|
|
|
adminpassFile = "/var/lib/nextcloud/admin-pass";
|
2021-11-15 10:02:05 +00:00
|
|
|
adminuser = "admin";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|