Add Rupert’s configuration
This commit is contained in:
commit
2b4264d32d
31 changed files with 1742 additions and 0 deletions
62
hosts/nextcloud.nix
Normal file
62
hosts/nextcloud.nix
Normal file
|
@ -0,0 +1,62 @@
|
|||
{ config, lib, pkgs, ... }:
|
||||
let
|
||||
hostName = (lib.toLower config.networking.hostName) + ".gvfr.de";
|
||||
in
|
||||
{
|
||||
services.nextcloud = {
|
||||
enable = true;
|
||||
https = true;
|
||||
package = pkgs.nextcloud25;
|
||||
hostName = hostName;
|
||||
datadir = "/data/nextcloud";
|
||||
config = {
|
||||
dbtype = "pgsql";
|
||||
dbhost = "/run/postgresql";
|
||||
adminpassFile = "/secrets/nextcloud_admin_password.txt";
|
||||
extraTrustedDomains = [
|
||||
((lib.toLower config.networking.hostName) + ".lan")
|
||||
(lib.toLower config.networking.hostName)
|
||||
];
|
||||
};
|
||||
caching.redis = true;
|
||||
enableBrokenCiphersForSSE = false;
|
||||
};
|
||||
|
||||
services.postgresql = {
|
||||
enable = true;
|
||||
ensureUsers = [
|
||||
{
|
||||
name = "nextcloud";
|
||||
ensurePermissions = {
|
||||
"DATABASE nextcloud" = "ALL PRIVILEGES";
|
||||
};
|
||||
}
|
||||
{
|
||||
name = "superuser";
|
||||
ensurePermissions = {
|
||||
"ALL TABLES IN SCHEMA public" = "ALL PRIVILEGES";
|
||||
};
|
||||
}
|
||||
];
|
||||
ensureDatabases = [ "nextcloud" ];
|
||||
};
|
||||
|
||||
# Ensure that postgres is running *before* running the setup
|
||||
systemd.services."nextcloud-setup" = {
|
||||
requires = ["postgresql.service"];
|
||||
after = ["postgresql.service"];
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [ 80 443 ];
|
||||
|
||||
services.nginx = {
|
||||
virtualHosts.${hostName} = {
|
||||
forceSSL = true;
|
||||
enableACME = true;
|
||||
};
|
||||
};
|
||||
|
||||
users.extraGroups.music = {
|
||||
members = [ "nextcloud" ];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue