# # Nextcloud Service Configuration # services.nextcloud = { enable = true; # The hostname Nextcloud will use. This should be how you access it in your browser. # If you don't have a domain, use your server's IP address. hostName = "nextcloud.local"; # <--- IMPORTANT: Change to your actual domain or IP # Use the built-in web server (Apache in this case) provided by the Nextcloud module. # This means you don't need to configure services.httpd or services.nginx separately. inheritBuiltinWebserver = true; # Directory where Nextcloud will store user data. # Ensure this path is on a persistent storage volume. dataDir = "/var/lib/nextcloud/data"; # <--- IMPORTANT: Ensure this path is suitable for your setup # Database configuration: PostgreSQL is recommended for production. database = { type = "postgresql"; createLocally = true; # NixOS will manage and create the PostgreSQL database userName = "nextcloud"; # Database username for Nextcloud # Securely store the database password in a file. # You MUST create this file before rebuilding your system (see instructions below). passwordFile = "/run/keys/nextcloud-db-password"; }; # Nextcloud application-specific configuration options. # These map directly to Nextcloud's config.php settings. config = { # The host Nextcloud will use for internal redirects. Should match hostName. overwritehost = "nextcloud.local"; # <--- IMPORTANT: Adjust if using a different hostname/IP # List of trusted domains/IPs from which Nextcloud can be accessed. # Add your server's IP address and any domain names you'll use. trusted_domains = [ "nextcloud.local" # <--- IMPORTANT: Add your domain or IP here "192.168.1.100" # <--- IMPORTANT: Replace with your server's actual IP address ]; # Configure local memory caching for performance. APCu is recommended. memcache.local = "\\OC\\Memcache\\APCu"; }; # PHP FPM options required by Nextcloud for optimal performance. phpOptions = { "opcache.enable" = true; "opcache.interned_strings_buffer" = 8; "opcache.max_accelerated_files" = 10000; "opcache.memory_consumption" = 128; "opcache.save_comments" = 1; "opcache.revalidate_freq" = 1; "apc.enable_cli" = 1; }; };