Unfortunately Nextcloud appears to be very stateful when it comes to managing its own configuration. The
config file lives in the home directory of the <literal>nextcloud</literal> user (by default
<literal>/var/lib/nextcloud/config/config.php</literal>) and is also used to track several
states of the application (e.g. whether installed or not).
</para>
<para>
Right now changes to the <literal>services.nextcloud.config</literal> attribute set won't take effect
after the first install
(except <literal><linklinkend="opt-services.nextcloud.config.extraTrustedDomains">services.nextcloud.config.extraTrustedDomains</link></literal>) since the actual configuration
file is generated by the NextCloud installer which also sets up critical parts such as the database
structure.
</para>
<para>
<emphasis>Warning: don't delete <literal>config.php</literal>! This file tracks the application's state and a deletion can cause unwanted side-effects!</emphasis>
</para>
<para>
<emphasis>Warning: don't rerun <literal>nextcloud-occ maintenance:install</literal>! This command tries to install the application and can cause unwanted side-effects!</emphasis>
</para>
<para>
The issues are known and reported in <linkxlink:href="https://github.com/NixOS/nixpkgs/issues/49783">#49783</link>, for now it's unfortunately necessary to manually work around these issues.