Browse Source

nixops: add nextcloud configuration

Signed-off-by: Chinmay D. Pai <chinmaydpai@gmail.com>
master
Chinmay D. Pai 2 months ago
parent
commit
1706681197
Signed by: thunderbottom GPG Key ID: 75507BE256F40CED
1 changed files with 56 additions and 0 deletions
  1. +56
    -0
      nixops/services/nextcloud.nix

+ 56
- 0
nixops/services/nextcloud.nix View File

@ -0,0 +1,56 @@
# NixOps configuration for the hosts running Gitea
{ config, pkgs, lib, ... }:
let
nextcloud-db-keyfile = "nextcloud-postgres"; # deployment.keys for db password
in {
services.nextcloud = {
enable = true;
hostName = "cloud.maych.in";
https = true;
maxUploadSize = "1G";
package = pkgs.nextcloud20;
autoUpdateApps = {
enable = true;
startAt = "05:00:00";
};
config = {
adminuser = "admin";
adminpassFile = "/run/keys/nextcloud-admin";
dbtype = "pgsql";
dbuser = "nextcloud";
dbhost = "/run/postgresql";
dbname = "nextcloud";
dbpassFile = "/run/keys/${nextcloud-db-keyfile}";
overwriteProtocol = "https";
};
};
services.postgresql = {
enable = true;
ensureDatabases = [ "nextcloud" ];
ensureUsers = [
{
name = "nextcloud";
ensurePermissions."DATABASE nextcloud" = "ALL PRIVILEGES";
}
];
};
services.nginx = {
virtualHosts."cloud.maych.in" = {
enableACME = true;
forceSSL = true;
};
};
systemd.services."nextcloud-setup" = {
after = [ "nextcloud-admin-key.service" "${nextcloud-db-keyfile}-key.service" "postgres.service" ];
wants = [ "nextcloud-admin-key.service" "${nextcloud-db-keyfile}-key.service" "postgres.service" ];
};
users.users.nextcloud.extraGroups = [ "keys" ];
}

Loading…
Cancel
Save