-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnextcloud.nix
67 lines (67 loc) · 2.34 KB
/
nextcloud.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
{ self, config, lib, pkgs, ... }: {
# Based on https://carjorvaz.com/posts/the-holy-grail-nextcloud-setup-made-easy-by-nixos/
security.acme = {
acceptTerms = true;
defaults = {
email = "wes+barn-acme@jupiterbroadcasting.com";
dnsProvider = "cloudflare";
# location of your CLOUDFLARE_DNS_API_TOKEN=[value]
# https://www.freedesktop.org/software/systemd/man/latest/systemd.exec.html#EnvironmentFile=
environmentFile = "/REPLACE/WITH/YOUR/PATH";
};
};
services = {
nginx.virtualHosts = {
"YOUR.DOMAIN.NAME" = {
forceSSL = true;
enableACME = true;
# Use DNS Challenege.
acmeRoot = null;
};
};
#
nextcloud = {
enable = true;
hostName = "YOUR.DOMAIN.NAME";
# Need to manually increment with every major upgrade.
package = pkgs.nextcloud28;
# Let NixOS install and configure the database automatically.
database.createLocally = true;
# Let NixOS install and configure Redis caching automatically.
configureRedis = true;
# Increase the maximum file upload size.
maxUploadSize = "16G";
https = true;
autoUpdateApps.enable = true;
extraAppsEnable = true;
extraApps = with config.services.nextcloud.package.packages.apps; {
# List of apps we want to install and are already packaged in
# https://github.com/NixOS/nixpkgs/blob/master/pkgs/servers/nextcloud/packages/nextcloud-apps.json
inherit calendar contacts notes onlyoffice tasks cookbook qownnotesapi;
# Custom app example.
socialsharing_telegram = pkgs.fetchNextcloudApp rec {
url =
"https://github.com/nextcloud-releases/socialsharing/releases/download/v3.0.1/socialsharing_telegram-v3.0.1.tar.gz";
license = "agpl3";
sha256 = "sha256-8XyOslMmzxmX2QsVzYzIJKNw6rVWJ7uDhU1jaKJ0Q8k=";
};
};
settings = {
overwriteProtocol = "https";
default_phone_region = "US";
};
config = {
dbtype = "pgsql";
adminuser = "admin";
adminpassFile = "/REPLACE/WITH/YOUR/PATH";
};
# Suggested by Nextcloud's health check.
phpOptions."opcache.interned_strings_buffer" = "16";
};
# Nightly database backups.
postgresqlBackup = {
enable = true;
startAt = "*-*-* 01:15:00";
};
};
}