nixos/onlyoffice: web access leads to welcome 404
Nixpkgs version
- Unstable (25.05)
Describe the bug
OpenOffice is installed simply with:
services.onlyoffice = {
enable = true;
hostname = "office.cynerd.cz";
};
Steps to reproduce
Just a simple installation. The only addition I have in nginx is the setup of SSL:
"office.cynerd.cz" = {
forceSSL = true;
useACMEHost = "cynerd.cz";
};
Expected behaviour
The access of onlyoffice and not nginx's html directory
Screenshots
No response
Relevant log output
The log from nginx:
Apr 25 11:31:16 lipwig nginx[3402044]: 2025/04/25 11:31:16 [error] 3402044#3402044: *1071 "/nix/store/hdzj6v664c2z4xjislk3fpv4k2fbvfv5-nginx-1.26.3/html/welcome/index.html" is not found (2: No such file or directory), client: 109.183.157.101, server: office.cynerd.cz, request: "GET /welcome/ HTTP/2.0", host: "office.cynerd.cz"
Additional context
No response
System metadata
- system:
"x86_64-linux" - host os:
Linux 6.14.2, NixOS, 25.05 (Warbler), 25.05.20250413.18dd725 - multi-user?:
yes - sandbox:
yes - version:
nix-env (Nix) 2.28.1 - nixpkgs:
/nix/store/xq5a7r968cjr705jvsdb9kryhwax437q-nixos-22.05.1302.dbb62c34bbb/nixos
Notify maintainers
@BonusPlay @xdbr
Note for maintainers: Please tag this issue in your pull request description. (i.e. Resolves #ISSUE.)
I assert that this issue is relevant for Nixpkgs
- [x] I assert that this is a bug and not a support request.
- [x] I assert that this is not a duplicate of an existing issue.
- [x] I assert that I have read the NixOS Code of Conduct and agree to abide by it.
Is this issue important to you?
Add a :+1: reaction to issues you find important.
Still experiencing this issue on Nixpkgs 25.11.20250814.fbcf476 (Xantusia).
To be clear, I do not maintain onlyoffice packages/modules. I once used them as integration to self-hosted nextcloud, howerver I aftear learning that integration never worked (which results in data loss) I have switched to collabora.
I think the collision is caused by them both trying to set services.nginx.virtualHosts.${cfg.hostName}
https://github.com/NixOS/nixpkgs/blob/1a29a2f41e34a042058ef007d0c5e4eb0335c888/nixos/modules/services/web-apps/onlyoffice.nix#L107
https://github.com/NixOS/nixpkgs/blob/1a29a2f41e34a042058ef007d0c5e4eb0335c888/nixos/modules/services/web-apps/nextcloud.nix#L1434
setting services.onlyoffice.hostname = "sonethingrandom"; fixes the collision. How is this usually handled? I can't imagine this is the first time two packages have wanted to use nginx at the same time
I'm still getting this error when I try to set it up in nextcloud:
Error when trying to connect (Error occurred in the document service: Error while downloading the document file to be converted.) (version 8.3.3.18)
I think the collision is caused by them both trying to set
services.nginx.virtualHosts.${cfg.hostName}nixpkgs/nixos/modules/services/web-apps/onlyoffice.nix
Line 107 in 1a29a2f virtualHosts.${cfg.hostname} = {
nixpkgs/nixos/modules/services/web-apps/nextcloud.nix
Line 1434 in 1a29a2f services.nginx.virtualHosts.${cfg.hostName} = {
setting
services.onlyoffice.hostname = "sonethingrandom";fixes the collision. How is this usually handled? I can't imagine this is the first time two packages have wanted to use nginx at the same time
In NixOS modules, cfg is often assigned as shorthand for the module itself, using the let ... in syntax. For example in the Onlyoffice module:
https://github.com/NixOS/nixpkgs/blob/1a29a2f41e34a042058ef007d0c5e4eb0335c888/nixos/modules/services/web-apps/onlyoffice.nix#L9
and in the Nextcloud module:
https://github.com/NixOS/nixpkgs/blob/1a29a2f41e34a042058ef007d0c5e4eb0335c888/nixos/modules/services/web-apps/nextcloud.nix#L8
The let ... in assignments only apply in the scope of the module, so this shouldn't be a cause of conflicts between modules.