45 lines
1.1 KiB
Nix
45 lines
1.1 KiB
Nix
{ pkgs, config, ... }:
|
|
{
|
|
sops.secrets.nextcloud-adminpass = {
|
|
owner = "nextcloud";
|
|
sopsFile = ./secrets.yaml;
|
|
};
|
|
|
|
services.nextcloud = {
|
|
enable = true;
|
|
hostName = "nextcloud.cloonar.com";
|
|
https = true;
|
|
package = pkgs.nextcloud27;
|
|
# Instead of using pkgs.nextcloud27Packages.apps,
|
|
# we'll reference the package version specified above
|
|
extraApps = with config.services.nextcloud.package.packages.apps; {
|
|
inherit contacts calendar tasks;
|
|
};
|
|
extraAppsEnable = true;
|
|
|
|
config = {
|
|
adminpassFile = config.sops.secrets.nextcloud-adminpass.path;
|
|
dbtype = "mysql";
|
|
dbhost = "/run/mysqld/mysqld.sock";
|
|
};
|
|
};
|
|
|
|
services.nginx.virtualHosts.${config.services.nextcloud.hostName} = {
|
|
forceSSL = true;
|
|
enableACME = true;
|
|
acmeRoot = null;
|
|
};
|
|
|
|
config.services.mysql.ensureUsers = [
|
|
{
|
|
name = "nextcloud";
|
|
ensurePermissions = {
|
|
"nextcloud.*" = "ALL PRIVILEGES";
|
|
};
|
|
}
|
|
];
|
|
|
|
config.services.mysql.ensureDatabases = [ "nextcloud" ];
|
|
config.services.mysqlBackup.databases = [ "nextcloud" ];
|
|
}
|