the nix module nextcloud has the options
services.nextcloud.config.dbpassFile
services.nextcloud.config.adminpassFile
Which seem perfect to use with nixops’ deployment.keys.
option
deployment.keys.nextcloud-db-pass.text = builtins.readFile ./nextcloud-db-pass.key;
deployment.keys.nextcloud-db-pass.user = "nextcloud";
deployment.keys.nextcloud-db-pass.group = "nextcloud";
deployment.keys.nextcloud-admin-pass.text = builtins.readFile ./nextcloud-admin-pass.key;
deployment.keys.nextcloud-admin-pass.user = "nextcloud";
deployment.keys.nextcloud-admin-pass.group = "nextcloud";
services.nextcloud.config.dbpassFile = "/run/keys/nextcloud-db-pass";
services.nextcloud.config.adminpassFile = "/run/keys/nextcloud-admin-pass";
But this results in nextcloud complaining about these files not existing?
"Cannot start Nextcloud, dbpass file nextcloud-db-pass set by NixOS doesn't exist!",
So I added this:
systemd.services."nextcloud-setup" = {
requires = [
"nextcloud-db-pass-key.service"
"nextcloud-admin-pass-key.service"
];
after = [
"nextcloud-db-pass-key.service"
"nextcloud-admin-pass-key.service"
];
};
But Nextcloud still complains that these files do not exists. Is this just a permission error or am I missing something else?