{ config, lib, pkgs, inputs, ... }: { options.sysconfig.opts.virtualization.nextcloud.enable = lib.options.mkOption { type = lib.types.bool; default = false; }; imports = [ inputs.simple-nixos-mailserver.nixosModule ]; config = lib.mkIf config.sysconfig.opts.virtualization.nextcloud.enable { /*services.nginx.virtualHosts."localhost".listen = [ { addr = "0.0.0.0"; port = 8081; } ]; services.nextcloud = { enable = true; package = pkgs.nextcloud30; hostName = "localhost"; config = { adminpassFile = config.sops.secrets."nextcloud/pass".path; adminuser = "root"; dbtype = "mysql"; }; https = true; datadir = "/ssd1/Nextcloud/data"; home = "/ssd1/Nextcloud/nextcloud_home"; appstoreEnable = true; extraApps = with config.services.nextcloud.package.packages.apps; { inherit mail contacts calendar tasks user_oidc; }; extraAppsEnable = true; settings = { overwriteprotocol = "https"; trusted_domains = [ "nextcloud.blunkall.us" "dummy.blunkall.us" ]; trusted_proxies = [ "192.168.100.11" ]; default_phone_region = "US"; }; database.createLocally = true; };*/ containers.nextcloud = { autoStart = false; privateNetwork = true; hostAddress = "192.168.100.10"; localAddress = "192.168.100.15"; bindMounts = { "/etc/nextcloud" = { hostPath = "/ssd1/Nextcloud"; isReadOnly = false; }; "/etc/nextcloud-admin-pass" = { hostPath = config.sops.secrets."nextcloud/pass".path; isReadOnly = false; }; }; config = { config, lib, pkgs, ... }: { networking.firewall.allowedTCPPorts = [ 80 443 ]; services.nginx.virtualHosts."192.168.100.15".listen = [ { addr = "0.0.0.0"; port = 80; } ]; services.nextcloud = { enable = true; package = pkgs.nextcloud30; hostName = "localhost"; config = { adminpassFile = "/etc/nextcloud-admin-pass"; adminuser = "root"; dbtype = "mysql"; }; https = true; datadir = "/ssd1/Nextcloud/data"; home = "/ssd1/Nextcloud/nextcloud_home"; appstoreEnable = true; extraApps = with config.services.nextcloud.package.packages.apps; { inherit mail contacts calendar tasks user_oidc; }; extraAppsEnable = true; settings = { overwriteprotocol = "https"; trusted_domains = [ "nextcloud.blunkall.us" "dummy.blunkall.us" ]; trusted_proxies = [ "192.168.100.11" ]; default_phone_region = "US"; }; database.createLocally = true; }; system.stateVersion = "23.05"; }; }; }; }