Commit graph

335 commits

Author SHA1 Message Date
Maximilian Bosch c3615b0f5d
nixos/nextcloud: Allow disabling initial admin user creation on Nextcloud >= 32 (#418378) 2025-10-27 11:24:44 +00:00
provokateurin e4629f0dda
nixos/nextcloud: Fix fetchNextcloudApp example 2025-10-23 09:52:20 +02:00
Maximilian Bosch b4fd706dd8
nixos/nextcloud: prevent nextcloud-occ arguments being parsed by wrapper (#451187) 2025-10-22 11:13:25 +00:00
provokateurin e739c5d78d
nixos/nextcloud: Allow disabling initial admin user creation on Nextcloud >= 32
With https://github.com/nextcloud/server/pull/53212 it is not longer necessary to specify a username and password for an initial admin account during installation.
2025-10-13 20:47:01 +02:00
Maximilian Bosch ddb9127071
nixos/nextcloud: remove ancient stateVersion conditions 2025-10-12 19:26:07 +02:00
hotburger 7dcdee8d0a
nixos/nextcloud: prevent nextcloud-occ arguments being parsed by wrapper 2025-10-11 17:35:03 -07:00
Maximilian Bosch 285ea04d23
nextcloud32: init at 32.0.0 (#446632) 2025-10-09 18:00:09 +00:00
teutat3s ed6fed3410
nixos/nextcloud: recommended nginx headers should
not be optional, because upstream recommends them
https://docs.nextcloud.com/server/stable/admin_manual/installation/harden_server.html#serve-security-related-headers-by-the-web-server
2025-10-09 10:09:42 +02:00
teutat3s c794451fee
nixos/nextcloud: avoid duplicate X-Robots-Tag header
We already set this header in nginx, and a duplicate header can lead to
issues, like: https://github.com/nextcloud/notes-android/issues/2848
2025-10-09 09:42:29 +02:00
provokateurin f8d0f08acc
nixos/nextcloud: Use php84 by default
php84 is supported by nextcloud31 and nextcloud32 and brings some additional performance improvements in nextcloud32.
2025-10-07 09:45:28 +02:00
provokateurin 34a7111f89
nextcloud32: init at 32.0.0 2025-10-07 09:45:28 +02:00
Wolfgang Walther 91a8fee3aa
treewide: remove redundant parentheses
Auto-fixed by nixf-diagnose.
2025-10-05 10:52:03 +02:00
provokateurin 3afd6ec50d
nextcloud30: drop 2025-09-29 16:03:32 +02:00
provokateurin ba24e7fa23
nixos/nextcloud: Pass OC_PASS and NC_PASS environment variables to nextcloud-occ 2025-09-03 08:54:48 +02:00
Robert Schütz 06c99c29c9 nixos/nextcloud: remove X-XSS-Protection
see https://github.com/nextcloud/server/pull/53476
2025-08-31 10:14:01 +02:00
staticdev 2196fed2b6 fetchNextcloudApp: add sha512 2025-08-26 22:25:48 +02:00
6543 f7611cad51 nixos/nextcloud: unify usage of lib functions 2025-08-11 18:49:21 +02:00
Maximilian Bosch 3e41a080eb
Merge: nixos/nextcloud: configure redis by default (#421813) 2025-08-07 17:27:21 +02:00
Sandro Jäckel 9e2d007b94
nixos/nextcloud: configure redis by default 2025-07-26 23:31:35 +02:00
Sandro Jäckel 58def163c0
nixos/nextcloud: fix eval 2025-07-26 23:22:15 +02:00
6543 b6088b0d8e nixos/nextcloud: remove with lib usage 2025-07-24 17:00:10 +02:00
Maximilian Bosch 5d30429bbf
Merge: nixos/nextcloud: move phpPackage default into option (#423792) 2025-07-24 16:31:49 +02:00
Wolfgang Walther 5a0711127c
treewide: run nixfmt 1.0.0 2025-07-24 13:55:40 +02:00
Rémi NICOLE 16bf4a02fa
nixos/nextcloud: fix module maintainers (#427548) 2025-07-23 10:40:37 +08:00
Sandro Jäckel 81edb3c986
nixos/nextcloud: move phpPackage default into option
This allows it to be accessed like options.services.nextcloud.phpPackage.default

(cherry picked from commit 5a7afe0a331f97d7dbc65abe38f9a1807d2d753d)
2025-07-09 16:10:29 +02:00
Jeremy Fleischman 0a4c03ed81
nextcloud: add nextcloud.nginx.enableFastcgiRequestBuffering option
Enabling this option fixes (works around) Nextcloud's notorious "0 byte file"
issue. See these upstream issues:

- https://github.com/nextcloud/documentation/issues/9574
- https://github.com/nextcloud/server/issues/7995

This fixes https://github.com/NixOS/nixpkgs/issues/252980

Co-authored-by: Maximilian Bosch <6025220+Ma27@users.noreply.github.com>
2025-07-06 13:21:01 -07:00
Dominique Martinet 78a20758e0 nixos/nextcloud: add assertion explaining to set dbtype
Since 25.05 dbtype no longer defaults to sqlite and this yields an error
that is understandable enough but not easy to properly address.

Add an assert that is more explicit.

Before:
```
       error: The option `nodes.nextcloud.services.nextcloud.config.dbtype' was accessed but has no value defined. Try setting the option.
```

After:
```
       error:
       Failed assertions:
       - `services.nextcloud.config.dbtype` must be set explicitly (pgsql, mysql, or sqlite)

       Before 25.05, it used to default to sqlite but that is not recommended by upstream.
       Either set it to sqlite as it used to be, or convert to another type as described
       in the official db conversion page:
       https://docs.nextcloud.com/server/latest/admin_manual/configuration_database/db_conversion.html
```

Link: https://github.com/NixOS/nixpkgs/pull/369242#issuecomment-3036296243
2025-07-05 06:35:26 +09:00
Maximilian Bosch a064abed61
Merge: nixos/postgresql: move postStart into separate unit (#403645) 2025-06-27 18:09:54 +02:00
teutat3s 0c7a8d5255
nixos/nextcloud: sync nginx config with upstream
Upstream changes were checked by checking out the stable31 branch of the
https://github.com/nextcloud/documentation and comparing:

git diff c1c9b0a072537544769fdd6062989a631d4fb17c admin_manual/installation/nginx-root.conf.sample

Notably, this adds the text/javascript and application/wasm mime types to the list of
gzip'ed mime types, which improves nextcloud loading in our testing.

Also adds webp support.
2025-06-25 20:36:45 +02:00
Wolfgang Walther 41c5662cbe
nixos/postgresql: move postStart into separate unit
This avoids restarting the postgresql server, when only ensureDatabases
or ensureUsers have been changed. It will also allow to properly wait
for recovery to finish later.

To wait for "postgresql is ready" in other services, we now provide a
postgresql.target.

Resolves #400018

Co-authored-by: Marcel <me@m4rc3l.de>
2025-06-24 15:26:47 +02:00
Lukas Nagel 589374dd71 nixos/nextcloud: add php-systemd extension if log_type is "systemd" 2025-06-21 08:47:47 +02:00
Guillaume Girol deaa642681
nixos/nextcloud: configure only unique trusted_domains (#413386) 2025-06-21 00:16:01 +02:00
provokateurin 58003922a8
nixos/nextcloud: Remove unused version logic
All relevant versions are not supported anymore, therefore the version logic is no longer necessary.
2025-06-10 08:57:08 +02:00
6543 0019d96579 nixos/nextcloud: configure only unique trusted_domains 2025-06-02 23:51:51 +02:00
Maximilian Bosch 26126c75df
Merge: Use cacert in Nextcloud (#406252) 2025-05-15 18:50:53 +02:00
provokateurin 12f8199080
nixos/nextcloud: Override cacert package with config.security.pki.caBundle 2025-05-15 18:19:52 +02:00
provokateurin dfb7f45bb8
nixos/nextcloud: Disable integrity check 2025-05-11 21:34:33 +02:00
networkException 23468ad19f
nixos/nextcloud: use LoadCredential to read services.nextcloud.secretFile
This patch adds support for using systemd's LoadCredential
feature to read in a json file at a path defined in the
services.nextcloud.secretFile option.

This is a follow up to 2ce1e84103.
2025-05-10 20:36:01 +02:00
Riyyi 39fbbb7ba0
nixos/nextcloud: fix typo in extraApps example (#404314) 2025-05-05 17:00:50 +08:00
provokateurin 530c6f09c9
nixos/nextcloud: Disable web updater by default
Disables the "Open updater" button in the admin overview and makes sure it is not possible to update the instance through the web interface.
Nextcloud runs from the source code in the nix store and should not try to update itself manually.
The only way to update Nextcloud is to update nixpkgs and therefore the web updater must be disabled.
2025-04-23 17:08:25 +02:00
Maximilian Bosch 2cb444f4fc
Merge: nixos/nextcloud: S3: Rename autocreate (a no-op) to verify_bucket_exists (#399629) 2025-04-22 16:03:51 +02:00
provokateurin 1efc79ccca
nextcloud29: drop 2025-04-21 07:48:32 +02:00
Tom Hubrecht 08e859c8e0
nixos/nextcloud: S3: Rename autocreate (a no-op) to verify_bucket_exists
C.f. https://github.com/nextcloud/documentation/issues/10436

Co-authored-by: Tom Herbers <mail@tomherbers.de>
Co-authored-by: Kate <26026535+provokateurin@users.noreply.github.com>
2025-04-18 11:14:38 +02:00
Maximilian Bosch 39dcdc5c9b
nixos/nextcloud: check if ownership of config is correct
Follow-up on #169733

For `data`, Nextcloud checks on its own if everything is readable.
However, for `config` it's crucial that the ownership is actually
correct: otherwise, systemd-tmpfiles will refuse any operations inside
because of unsafe path transitions.

This can result in a subtly broken setup by the `override.config.php`
not being updated, but also not part of the system closure anymore
(another override.config.php is referenced now) which means it'll be
GCed eventually even though Nextcloud relies on it.

If this precondition is not met, the following error will be printed:

    nextcloud-setup-start[972]: /var/lib/nextcloud/config is not owned by user 'nextcloud'!
    nextcloud-setup-start[972]: Please check the logs via 'journalctl -u systemd-tmpfiles-setup'
    nextcloud-setup-start[972]: and make sure there are no unsafe path transitions.
    nextcloud-setup-start[972]: (https://nixos.org/manual/nixos/stable/#module-services-nextcloud-pitfalls-during-upgrade)
2025-04-02 09:30:17 +02:00
Silvan Mosberger 374e6bcc40 treewide: Format all Nix files
Format all Nix files using the officially approved formatter,
making the CI check introduced in the previous commit succeed:

  nix-build ci -A fmt.check

This is the next step of the of the [implementation](https://github.com/NixOS/nixfmt/issues/153)
of the accepted [RFC 166](https://github.com/NixOS/rfcs/pull/166).

This commit will lead to merge conflicts for a number of PRs,
up to an estimated ~1100 (~33%) among the PRs with activity in the past 2
months, but that should be lower than what it would be without the previous
[partial treewide format](https://github.com/NixOS/nixpkgs/pull/322537).

Merge conflicts caused by this commit can now automatically be resolved while rebasing using the
[auto-rebase script](8616af08d9/maintainers/scripts/auto-rebase).

If you run into any problems regarding any of this, please reach out to the
[formatting team](https://nixos.org/community/teams/formatting/) by
pinging @NixOS/nix-formatting.
2025-04-01 20:10:43 +02:00
Maximilian Bosch f20b220e17
Merge: nixos/nextcloud: add maintainer team, update docs about maintainership of apps (#393069) 2025-04-01 11:25:28 +02:00
Maximilian Bosch 65121c9333
Merge: nextcloud-occ: work with sudo disabled (#380211) 2025-03-29 23:25:45 +01:00
Maximilian Bosch d3110c9532
nextcloud: update maintainer information
* Create a dedicated team. Before, information was inconsistent between
  e.g. tests and package, module had none at all.
* Add maintainership from us to all trivially packaged apps. This is
  only to make sure that we take care of them building and installing
  and that's about it.
2025-03-25 12:41:18 +00:00
hot burger 2dad835033 nextcloud-occ: work with sudo disabled 2025-03-22 15:11:17 -07:00
provokateurin 34da0bd4fc
nixos/nextcloud: Also install when config.php exists but is empty
Running any occ command will create an empty config file automatically: f85154f1e1/lib/base.php (L194-L196)
This causes the current check to never execute the installation, in case any occ command was run before it (which itself fails because Nextcloud is not installled yet).
So any services which don't properly depend on nextcloud-setup.service cause Nextcloud to never be installed.
2025-03-21 14:51:30 +01:00