Greetings to all!
My nextcloud config so far, adapted from the prevailing pgsql example:
{ pkgs, ... }:
{
services.nextcloud = {
enable = true;
hostName = "nextcloud.local";
nginx.enable = true;
config = {
dbtype = "mysql";
dbuser = "nextcloud";
dbname = "nextcloud";
adminpassFile = "/pathto/nextcloud_admin_passfile";
adminuser = "root";
};
};
services.mysql = {
enable = true;
ensureDatabases = [ "nextcloud" ];
ensureUsers = [
{ name = "nextcloud";
ensurePermissions = { "nextcloud.*" = "ALL PRIVILEGES";};
}
];
package = pkgs.mariadb;
};
# ensure that the db is running *before* running the setup
systemd.services."nextcloud-setup" = {
requires = ["mysql.service"];
after = ["mysql.service"];
};
networking.firewall.allowedTCPPorts = [ 80 443 ];
}
- It ain’t working:
warning: the following units failed: nextcloud-setup.service
â—Ź nextcloud-setup.service
Loaded: loaded (/nix/store/mypj25db9x9fml19nrvnvahi6489jdkd-unit-nextcloud-setup.service/nextcloud-setup.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2020-10-06 14:56:17 CEST; 16ms ago
Process: 24314 ExecStart=/nix/store/ihhp6g2l3xvfz9wvp1xvi7r8sh34dy1n-unit-script-nextcloud-setup-start (code=exited, status=1/FAILURE)
Main PID: 24314 (code=exited, status=1/FAILURE)
IP: 0B in, 0B out
CPU: 121ms
Oct 06 14:56:17 nixos sudo[24320]: root : TTY=unknown ; PWD=/nix/store/83lmfh5bh69zwnhz177rfzf1ikqvg806-nextcloud-18.0.7 ; USER=nextcloud ; ENV=NEXTCLOUD_CONFIG_DIR=/var/lib/nextcloud/config ; COMMAND=/nix/store/vq6zsvvn8hacwdj5i7ck03rkm7fj2rgs-php-7.3.20/bin/php -c /nix/store/vkg0hz5f0ymmhi421bpnbmvp7hw4m9fr-php.ini occ upgrade...
Oct 06 14:56:17 nixos sudo[24320]: pam_unix(sudo:session): session opened for user nextcloud by (uid=0)
Oct 06 14:56:17 nixos ihhp6g2l3xvfz9wvp1xvi7r8sh34dy1n-unit-script-nextcloud-setup-start[24314]: Nextcloud is not installed - only a limited number of commands are available
Oct 06 14:56:17 nixos ihhp6g2l3xvfz9wvp1xvi7r8sh34dy1n-unit-script-nextcloud-setup-start[24314]:
Oct 06 14:56:17 nixos ihhp6g2l3xvfz9wvp1xvi7r8sh34dy1n-unit-script-nextcloud-setup-start[24314]: Command "upgrade" is not defined.
Oct 06 14:56:17 nixos ihhp6g2l3xvfz9wvp1xvi7r8sh34dy1n-unit-script-nextcloud-setup-start[24314]:
Oct 06 14:56:17 nixos sudo[24320]: pam_unix(sudo:session): session closed for user nextcloud
Oct 06 14:56:17 nixos systemd[1]: nextcloud-setup.service: Main process exited, code=exited, status=1/FAILURE
Oct 06 14:56:17 nixos systemd[1]: nextcloud-setup.service: Failed with result 'exit-code'.
Oct 06 14:56:17 nixos systemd[1]: Failed to start nextcloud-setup.service.
Hint: Some lines were ellipsized, use -l to show in full.
warning: error(s) occurred while switching to the new configuration
- I also tried
package = pkgs.mysql;
it still seems to use MariaDB…
Is someone out there with helpful hints?