Commit Graph

1169 Commits

Author SHA1 Message Date
h7x4
39e93806aa Revert "various: replace systemd.services.<name>.{script,preStart} with ExecStart{,Pre}" 2025-10-31 11:03:32 +01:00
h7x4
783087ba35 nixos/h2o: replace preStart with ExecStartPre 2025-10-27 18:52:25 +09:00
h7x4
3827112a15 nixos/jboss: replace systemd script with ExecStart 2025-10-27 18:52:08 +09:00
h7x4
1b42cb3018 nixos/nginx: lib.mapAttrsToList -> lib.attrValues 2025-10-26 15:33:34 +09:00
Leona Maroni
05026b194c nixos/nginx: remove deprecated vhost option enableSSL (#446053) 2025-10-23 13:36:01 +00:00
Lukas Wurzinger
1f4c50ab81 lib/cli: deprecate toGNUCommandLine 2025-10-21 21:01:38 +02:00
Aaron Andersen
02930bd6db httpd: change redirect status code to 301 when using forceSSL (#405295) 2025-10-16 00:09:51 +00:00
Leona Maroni
a2d81c0a43 nixos/nginx: allow adding new ACME certificates without nginx restart (#445544) 2025-10-14 07:52:56 +00:00
Wolfgang Walther
91a8fee3aa treewide: remove redundant parentheses
Auto-fixed by nixf-diagnose.
2025-10-05 10:52:03 +02:00
Leona Maroni
6b7e5a5aca nixos/nginx: remove deprecated vhost option enableSSL
The option services.nginx.virtualHost.<...>.enableSSL is deprecated for
8 years [^1]. It causes confusion for people who guess the option and
think it's the right one.
I think it's time to remove it for good.

^1: a912a6a291
2025-09-25 16:34:38 +02:00
Leona Maroni
b3a76d495e nixos/nginx: allow adding new ACME certificates without nginx restart
Currently, nginx gets restarted when adding a new ACME certificate, even
when `services.nginx.enableReload = true` because of changes in the
Wants/After/Before sections of `nginx.service`.
This change moves these dependencies to `nginx-config-reload.service` and
the respective ACME systemd units.
2025-09-25 10:36:42 +02:00
Leona Maroni
33dc105554 nixos/nginx: set X-Forwarded-Server proxy header to hostname
X-Forwarded-Server represents the last server in a row of reverse proxies
in the common use, see:
- https://www.fastly.com/documentation/reference/http/http-headers/X-Forwarded-Server/
- https://httpd.apache.org/docs/2.4/mod/mod_proxy.html#x-headers
- https://docs.valsight.com/on-premise/latest/reverse-proxy

X-Forwarded-Host instead is the original request host.

This change adapts our NGINX module to the common use of this header.
2025-09-23 22:22:35 +02:00
h7x4
776e13baaf nixos/stargazer: use more accurate int types 2025-09-22 16:36:16 +02:00
h7x4
27a6fc2af5 nixos/apache-httpd: use more accurate int types 2025-09-22 16:36:15 +02:00
h7x4
4ba3f60b8a various: use mkPackageOption 2025-09-22 02:46:54 +02:00
h7x4
9e5afcd5d2 nixos/php-fpm: enable systemd watchdog (#394441) 2025-09-12 12:22:04 +00:00
fredrikr79
8c13f3d7ff nixos/php-fpm: enable systemd watchdog 2025-09-12 14:09:26 +02:00
Haylin Moore
cf540f8c98 treewide/nixos: move number typed port options to types.port 2025-09-08 15:27:19 +02:00
dish
970dcca69c treewide: Fix links in module documentation 2025-08-25 12:55:11 -04:00
isabel
4ff7ee96bf nixos/nginx: add prependConfig options (#416411) 2025-08-16 18:55:51 +01:00
Leona Maroni
9b8ea589ea nixos/acme: improve scalability - reduce superfluous unit activations (#422076) 2025-08-14 16:06:06 +02:00
Jack Rosenberg
f26c52e8cf nixos/traefik: add WorkingDirectory 2025-08-11 11:03:17 +02:00
Christian Theune
2d0a489125 nixos/acme: improve scalability - reduce superfluous unit activations
The previous setup caused all renewal units to be triggered upon
ever so slight changes in config. In larger setups (100+ certificates)
adding a new certificate caused high system load and/or large memory
consumption issues. The memory issues are already a alleviated with
the locking mechanism. However, this then causes long delays upwards
of multiple minutes depending on individual runs and also caused
superfluous activations.

In this change we streamline the overall setup of units:

1. The unit that other services can depend upon is 'acme-{cert}.service'.
We call this the 'base unit'. As this one as `RemainAfterExit` set
the `acme-finished-{cert}` targets are not required any longer.

2. We now always generate initial self-signed certificates to simplify
the dependency structure. This deprecates the `preliminarySelfsigned`
option.

3. The `acme-order-renew-{cert}` service gets activated after the base
unit and services using certificates have started and performs all acme
interactions. When it finishes others services (like web servers) will
be notified through the `reloadServices` option or they can use
`wantedBy` and `after` dependencies if they implement their own reload
units.

The renewal timer also triggers this unit.

4. The timer unit is explicitly blocked from being started by s-t-c.

5. Permission management has been cleaned up a bit: there was an
   inconsistency between having the .lego files set to 600 vs 640
   on the exposed side. This is unified to 640 now.

6. Exempt the account target from being restarted by s-t-c. This will
   happen automatically if something relevant to the account changes.
2025-08-08 16:28:42 +02:00
Florian Klink
9e087896d6 nixos/caddy: Make virtualHosts' logFormat optional (#392390) 2025-08-07 08:48:08 +02:00
Jhonas Wernery
92b504d2ff nixos/garage: set LimitNOFILE (#429633)
Upstream uses 42000, see:
https://garagehq.deuxfleurs.fr/documentation/cookbook/systemd/
2025-07-30 19:55:09 +03:00
teutat3s
e62971b005 nixos/nginx: sync with Mozilla Intermediate TLS configuration
- adds ssl_ecdh_curve, per https://github.com/mozilla/ssl-config-generator/issues/76
- removes ssl_stapling, after Let's Encrypt ended support for OCSP
  stapling https://letsencrypt.org/2024/12/05/ending-ocsp/, enabling ssl_stapling
  leads to warning log spam:
```
  ssl_stapling" ignored, no OCSP responder URL in the certificate "<cert-directory>
```
2025-07-26 14:26:28 +02:00
Wolfgang Walther
5a0711127c treewide: run nixfmt 1.0.0 2025-07-24 13:55:40 +02:00
Wolfgang Walther
62fe016519 treewide: run treefmt with mdcr/nixfmt 2025-07-24 13:52:31 +02:00
Sandro Jäckel
0f964599a5 nixos/nginx: remove usage of recommendedZstdSettings and zstd settings duplication 2025-07-16 14:14:03 +02:00
Franz Pletz
9771deb49b nixos/nginx: remove recommendedZstdSettings, add experimental option (#381678) 2025-07-16 13:03:17 +02:00
Alex Martens
5420ae11ea nixos/minio: harden service 2025-07-16 11:18:45 +02:00
Christian Theune
8046e4a6f8 nixos/varnish: turn listen addresses into structured config
Introduces `services.varnish.listen` as a list of structured
listen addresses with all allowed variations of arguments
documented in the man page.

Deprecates `services.varnish.http_address`.
2025-07-08 13:52:55 +02:00
Franz Pletz
db75f90103 nixos/nginx: remove recommendedZstdSettings, add experimental option
The zstd nginx module has known bugs and upstream is currently not
maintained. We should not recommend a buggy module and configuration
to our users since we are not maintaining the module either.
2025-07-03 17:41:22 +02:00
Adam C. Stephens
b0dc55b783 garage: remove 0.8, mark 0.9 eol, rename 1.0 (#419392) 2025-06-28 10:18:34 -04: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
Adam C. Stephens
2b90c413df garage_1_x: rename to garage_1 2025-06-23 17:53:02 -04:00
Adam C. Stephens
45c0608ace garage_0_9: mark eol 2025-06-23 17:49:22 -04:00
Ryan Yin
aa9343b00e nixos/minio: add ryan4yin as a maintainer 2025-06-22 14:25:21 +08:00
vdbe
b8d052a70d nixos/nginx: add prependConfig options
This is needed for example to load dynamic nginx modules.
Which need to be loaded before any `http` or `stream` blocks.
See: https://docs.nginx.com/nginx/admin-guide/dynamic-modules/dynamic-modules/#installing-and-loading-the-module
2025-06-13 12:21:18 +02:00
Maximilian Bosch
4a2a4193f9 nixos/nginx: fix type of mapHashBucketSize
While the default is indeed 32/64/128, the option accepts any `size`[1]
including values >128, as observed in a customer project.

[1] https://nginx.org/en/docs/http/ngx_http_map_module.html
2025-06-05 14:58:17 +02:00
Stefan Mielke
58521a94fd httpd: change redirect status code to 301 when using forceSSL 2025-05-08 18:36:19 +02:00
Bert Proesmans
4c02c43a42 nixos/nginx: fix mkDefaultListenVhost mapping for unix sockets 2025-04-03 19:57:26 +00:00
โทสฺตัล
7554581474 nixos/h2o: enable HTTP/3 via QUIC 2025-04-02 15:11:53 +07:00
โทสฺตัล
301581e073 nixos/h2o: typo 2025-04-02 15:11:53 +07:00
Florian Klink
2b0e0a9fd4 nixos/h2o: disable OCSP stapling w/ Let’s Encrypt (support sunset) (#393765) 2025-04-02 09:10:42 +01: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
โทสฺตัล
7c8b3c88bb nixos/h2o: rename certNames → acmeCertNames
We are in agreement ðis improves the naming clarity
2025-03-29 12:31:46 +07:00
โทสฺตัล
0c67557015 nixos/h2o: disable OCSP stapling w/ Let’s Encrypt (support sunset)
It was noted in the TLS recommendations comment, but it actually should
be disabled everywhere if ACME is used as H2O has in enabled by default.

More info: <https://letsencrypt.org/2024/12/05/ending-ocsp/>
2025-03-29 12:31:46 +07:00
Felix Buehler
3546e59acc Revert "nixos/caddy: validate at build-time"
This reverts commit 63b6df42de.
2025-03-27 20:25:54 +01:00
Felix Bühler
fb0fb09b5c nixos/caddy: validate at build-time (#377075) 2025-03-25 22:53:00 +01:00