Added nextcloud module
This commit is contained in:
parent
89da451d18
commit
d6bf38b497
5 changed files with 59 additions and 0 deletions
|
@ -60,6 +60,8 @@ in {
|
|||
};
|
||||
|
||||
networking.firewall = {
|
||||
# TODO: Remove this here and leave it up to systems to decide to enable
|
||||
# the firewall
|
||||
enable = true;
|
||||
allowedTCPPorts = [
|
||||
# Plain DNS
|
||||
|
|
46
modules/services/nextcoud/default.nix
Normal file
46
modules/services/nextcoud/default.nix
Normal file
|
@ -0,0 +1,46 @@
|
|||
{
|
||||
options,
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
format,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.aa.services.nextcloud;
|
||||
in {
|
||||
options.aa.services.nextcloud = with types; {
|
||||
enable = mkEnableOption "nextcloud";
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
age.secrets.nextcloud_admin = {
|
||||
file = ../../../secrets/nextcloud_admin.age;
|
||||
owner = "nextcloud";
|
||||
group = "nextcloud";
|
||||
};
|
||||
|
||||
services.nextcloud = {
|
||||
enable = true;
|
||||
package = pkgs.nextcloud27;
|
||||
hostName = "nextcloud.kilonull.com";
|
||||
https = true;
|
||||
database.createLocally = true;
|
||||
# Arbitrary large size
|
||||
maxUploadSize = "16G";
|
||||
config = {
|
||||
dbtype = "pgsql";
|
||||
adminuser = "alejandro";
|
||||
adminpassFile = config.age.secrets.nextcloud_admin.path;
|
||||
};
|
||||
};
|
||||
|
||||
# nextcloud module configures nginx, just need to specify SSL stuffs here
|
||||
services.nginx.virtualHosts.${config.services.nextcloud.hostName} = {
|
||||
forceSSL = true;
|
||||
useACMEHost = "kilonull.com";
|
||||
};
|
||||
|
||||
networking.firewall.allowedTCPPorts = [80 443];
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue