update nextcloud
This commit is contained in:
parent
fee2fa1967
commit
bd7ac2fb07
|
@ -1,28 +1,31 @@
|
|||
{ self, config, lib, pkgs, ... }:
|
||||
let
|
||||
domain = "cloud.sondell.org";
|
||||
nextcloud = pkgs.nextcloud28;
|
||||
in
|
||||
{
|
||||
|
||||
self,
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}: let
|
||||
domain = "cloud.sondell.org";
|
||||
nextcloud = pkgs.nextcloud29;
|
||||
in {
|
||||
environment.systemPackages = [
|
||||
nextcloud
|
||||
];
|
||||
systemd.timers."nextcloud-db-backup" = {
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig = {
|
||||
# OnBootSec = "5m";
|
||||
# OnUnitActiveSec = "5m";
|
||||
OnCalendar="*-*-* 2:00:00";
|
||||
Unit = "nextcloud-db-backup.service";
|
||||
};
|
||||
wantedBy = ["timers.target"];
|
||||
timerConfig = {
|
||||
# OnBootSec = "5m";
|
||||
# OnUnitActiveSec = "5m";
|
||||
OnCalendar = "*-*-* 2:00:00";
|
||||
Unit = "nextcloud-db-backup.service";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.services."nextcloud-db-backup" = {
|
||||
script = with pkgs; ''
|
||||
set -eu
|
||||
date=$(date --iso-8601)
|
||||
${postgresql}/bin/pg_dump "nextcloud" | ${openssh}/bin/ssh -i /etc/nixos/.secrets/tulpan Glenn@nas "cat - > back/nextcloud/sqldump/$date.sql"
|
||||
${postgresql}/bin/pg_dump "nextcloud" | ${openssh}/bin/ssh -i /etc/nixos/.secrets/tulpan Glenn@nas "cat - > back/nextcloud/sqldump/$date.sql"
|
||||
'';
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
|
@ -30,7 +33,6 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
|
||||
services = {
|
||||
restic.backups = {
|
||||
"nextcloud" = {
|
||||
|
@ -50,7 +52,6 @@ in
|
|||
};
|
||||
};
|
||||
|
||||
|
||||
nginx.virtualHosts = {
|
||||
${domain} = {
|
||||
forceSSL = true;
|
||||
|
@ -60,7 +61,7 @@ in
|
|||
};
|
||||
};
|
||||
postgresql.enable = true;
|
||||
#
|
||||
#
|
||||
nextcloud = {
|
||||
enable = true;
|
||||
hostName = domain;
|
||||
|
@ -69,8 +70,8 @@ in
|
|||
# Let NixOS install and configure the database automatically.
|
||||
database.createLocally = true;
|
||||
# Increase the maximum file upload size.
|
||||
datadir="/pool/var/lib/nextcloud";
|
||||
|
||||
datadir = "/pool/var/lib/nextcloud";
|
||||
|
||||
maxUploadSize = "16G";
|
||||
https = true;
|
||||
autoUpdateApps.enable = true;
|
||||
|
@ -81,18 +82,18 @@ in
|
|||
maintenance_window_start = 1;
|
||||
};
|
||||
extraOptions = {
|
||||
# redis = {
|
||||
# # host = "/run/redis/redis.sock";
|
||||
# port = 0;
|
||||
# dbindex = 0;
|
||||
# password = "secret";
|
||||
# timeout = 1.5;
|
||||
# };
|
||||
# redis = {
|
||||
# # host = "/run/redis/redis.sock";
|
||||
# port = 0;
|
||||
# dbindex = 0;
|
||||
# password = "secret";
|
||||
# timeout = 1.5;
|
||||
# };
|
||||
};
|
||||
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 mail calendar contacts notes onlyoffice tasks cookbook;
|
||||
inherit mail calendar contacts notes onlyoffice cookbook;
|
||||
};
|
||||
config = {
|
||||
overwriteProtocol = "https";
|
||||
|
@ -118,6 +119,6 @@ in
|
|||
services.nginx.virtualHosts."office.sondell.org" = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
# locations."/".proxyPass = "http://12:8123";
|
||||
# locations."/".proxyPass = "http://12:8123";
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue