Commit Graph

993 Commits

Author SHA1 Message Date
Emery Hemingway
60c75135f8 nixos/nginx: add validateConfigFile option
Add an option to disable configuration file processing and
validation.
2024-05-09 16:48:26 +02:00
Niklas Hambüchen
9d7a729277 treewide: ReadWriteDirectories -> ReadWritePaths.
These were renamed in systemd v231:
2a624c36e6
2024-05-07 01:06:02 +02:00
Niklas Hambüchen
7b6b627a66 nixos/caddy: Comment why ExecStart is reset 2024-05-06 03:18:29 +02:00
Lynn
a586e82ef6 nixos/nginx: don't add .well-known locations for acme when using DNS-01 challenge 2024-05-01 16:48:07 +02:00
Sandro Jäckel
8db512dae8 nixos/nginx: update ciphers list 2024-04-22 23:08:14 +10:00
Sandro
f417891699
Merge pull request #293954 from Dan-Theriault/refactor-tailscale-auth 2024-04-18 15:14:01 +02:00
Dan Theriault
3cf6c4ddb3 nixos/tailscale-auth: init module
This additional module allows the tailscale auth proxy to be configured
independently of nginx. The tailscale auth proxy works with both caddy
and traefik. All prior nginx/tailscale-auth options are retained as
aliases.
2024-04-16 19:06:08 -04:00
Kerstin Humm
d6e8934f38
nixos/nginx: allow for resolving IPv6 addresses only 2024-04-16 23:44:11 +02:00
stuebinm
6afb255d97 nixos: remove all uses of lib.mdDoc
these changes were generated with nixq 0.0.2, by running

  nixq ">> lib.mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> mdDoc[remove] Argument[keep]" --batchmode nixos/**.nix
  nixq ">> Inherit >> mdDoc[remove]" --batchmode nixos/**.nix

two mentions of the mdDoc function remain in nixos/, both of which
are inside of comments.

Since lib.mdDoc is already defined as just id, this commit is a no-op as
far as Nix (and the built manual) is concerned.
2024-04-13 10:07:35 -07:00
Janne Heß
bc77c7a973 treewide: Mark Nix blocks in markdown as Nix
This should help us with highlighting and future formatting.
2024-03-28 09:28:12 +01:00
Lily Foster
e3c0bb4255
Merge pull request #294542 from Janik-Haag/garage
nixos/garage: add env-var wrapper for admin cli
2024-03-18 16:10:15 -07:00
Janik H.
9ec0e31f79
nixos/garage: add env-var wrapper for admin cli 2024-03-18 22:53:21 +01:00
Pol Dellaiera
2bd0c18d98
Merge pull request #282160 from gaykitty/stargazer-debug-mode
nixos/stargazer: add missing debugMode setting
2024-03-10 14:31:06 +01:00
gaykitty
366147b86d nixos/stargazer: add missing debugMode setting 2024-03-09 11:04:27 -05:00
adisbladis
3209343527 nixos/zope2: Remove module
`zope2` is unmaintained and the module is relying on Python2.
2024-02-18 17:48:24 +13:00
emilylange
993083f0ab
nixos/garage: allow all available log levels in cfg.logLevel
`error` and `warn` have always been valid log levels.
But because the upstream docs never mentioned those, we simply didn't
add them to the enum of our module option.

The upstream docs have been updated and now mention `error` and `warn`
as well.

Upstream PR: https://git.deuxfleurs.fr/Deuxfleurs/garage/pulls/716
2024-02-13 20:26:29 +01:00
Peder Bergebakken Sundt
bf7c95ce73
Merge pull request #285314 from pbsds/ttyd-1706718068
nixos/ttyd: add `entrypoint` and `writable` option
2024-02-13 19:41:11 +01:00
Peder Bergebakken Sundt
a8880f1647 nixos/ttyd: add entrypoint option 2024-02-05 17:38:00 +01:00
Robert Schütz
1dd5f2b1f9 nixos/nginx: turn auth_request off for ACME challenge
This is e.g. necessary when using tailscale-nginx-auth.
2024-02-05 00:33:33 -08:00
Peder Bergebakken Sundt
0d13d2a90f nixos/ttyd: remove with lib; 2024-01-31 17:58:59 +01:00
Peder Bergebakken Sundt
4c70703931 nixos/ttyd: add writable option
Co-authored-by: Carsten Rodin <19612711+carstoid@users.noreply.github.com>
2024-01-31 17:57:42 +01:00
Felix Buehler
d35003e302 python311Packages.recursive-pth-loader: rename from recursivePthLoader 2024-01-25 22:13:17 +01:00
Nick Cao
9969fb7ff4
Merge pull request #281904 from Stunkymonkey/ttyd-fix-leakage
ttyd: add test & use systemd LoadCredential
2024-01-21 14:48:40 -05:00
Felix Buehler
c34493d7c0 ttyd: add test & use systemd LoadCredential 2024-01-20 21:01:51 +01:00
Jade Lovelace
6c5ab28fce nixos: fix a bunch of services missing dep on network-online.target
This was done by generating a truly hilarious configuration:

rg 'services\.[^.]+\.enable\t' opts-tags | cut -f1 > allonconfig.nix

The following were not tested due to other evaluation errors. They
should probably be manually audited.
services.amule
services.castopod
services.ceph
services.chatgpt-retrieval-plugin
services.clamsmtp
services.clight
services.dante
services.dex
services.discourse
services.dwm-status
services.engelsystem
services.foundationdb
services.frigate
services.frp
services.grocy
services.guacamole-client
services.hedgedoc
services.home-assistant
services.honk
services.imaginary
services.jitsi-meet
services.kerberos_server
services.limesurvey
services.mastodon
services.mediawiki
services.mobilizon
services.moodle
services.mosquitto
services.nextcloud
services.nullmailer
services.patroni
services.pfix-srsd
services.pgpkeyserver-lite
services.postfixadmin
services.roundcube
services.schleuder
services.self-deploy
services.slskd
services.spacecookie
services.statsd
services.step-ca
services.sympa
services.tsmBackup
services.vdirsyncer
services.vikunja
services.yandex-disk
services.zabbixWeb
2024-01-19 00:11:34 -08:00
Ryan Lahfa
6d8630efda
Merge pull request #270270 from SuperSandro2000/nginx-fastopen
nixos/nginx: filter more options when listening has quic
2024-01-12 20:01:29 +01:00
Ryan Lahfa
3287441158
Merge pull request #275484 from Izorkin/update-nginx-http3
nixos/nginx: disable automatic advertise of HTTP/3 protocol support
2024-01-12 19:49:18 +01:00
Peder Bergebakken Sundt
f489e99576
Merge pull request #277925 from Izorkin/update-nginx-http2
nixos/nginx: use new variant of http2 option for angie package
2024-01-12 01:40:18 +01:00
Izorkin
10c06cb060
nginx: enable ktls support by default 2024-01-01 12:02:57 +03:00
Izorkin
2fb0b52c50
nixos/nginx: disable automatic advertise of HTTP/3 protocol support
Automatic advertise in the `http` block about support of HTTP/3
protocol makes it difficult to automatically configure services
to work with it.
HTTP/3 availability must be manually advertised, preferably in
each location block.
2024-01-01 02:29:01 +03:00
Izorkin
d11fe979a2
nixos/nginx: use new variant of http2 option for angie package 2023-12-31 16:52:08 +03:00
Izorkin
ae5c0c1521
nixos/nginx: skip adding a comment to acmeLocation in nginx configuration 2023-12-30 23:50:02 +03:00
Izorkin
7f1b6d45af
nixos/nginx: change position acmeLocation in nginx configuration 2023-12-30 23:49:58 +03:00
Sandro Jäckel
157256f9dd
nixos/nginx: filter more options when listening has quic 2023-12-23 02:20:48 +01:00
Izorkin
86efccfa45
angie: init at 1.4.0 2023-12-17 22:43:13 +03:00
networkException
968905ab76
nixos/caddy: also increase socket send buffer size as recommended by upstream
this patch adjusts the `boot.kernel.sysctl."net.core.wmem_max"` to match the
value suggested in the quic-go wiki, just as `"net.core.wmem_max"`.

see fdfdc5df21
see https://github.com/quic-go/quic-go/issues/3923
2023-12-15 04:43:57 +01:00
Ryan Lahfa
3bb93fb2cd
Merge pull request #271506 from Misterio77/nginx-redirect-status-code 2023-12-12 14:05:33 +01:00
Gabriel Fontes
a3c60d2ddc
nixos/nginx: make redirect status code configurable
Add an option to configure which code globalRedirect and forceSSL use.
It previously was always 301 with no easy way to override.
2023-12-11 11:09:02 -03:00
Sandro Jäckel
78541e68eb
nixos/nginx: allow return to be an int 2023-12-08 15:04:27 +01:00
Florian Klink
4db2e0cc80
Merge pull request #272542 from Sohalt/caddy-config-file
nixos/caddy: use caddyfile adapter by default with explicit configFile
2023-12-07 09:07:35 +02:00
sohalt
3c6b3d71fa nixos/caddy: Use caddyfile adapter by default when explicitly specifying configFile 2023-12-06 21:57:21 +01:00
phaer
c40f706dc4 nixos/nginx/tailscale-auth: init module 2023-12-06 20:57:38 +01:00
Mario Rodas
15b5295311
Merge pull request #270847 from anthonyroussel/updates/tomcat_10_1_16
tomcat10: 10.1.15 -> 10.1.16
2023-11-30 22:38:23 -05:00
Anthony Roussel
9a5f5ee7d3
nixos/tomcat: add anthonyroussel to maintainers 2023-11-29 07:56:09 +01:00
h7x4
0a37316d6c
treewide: use mkPackageOption
This commit replaces a lot of usages of `mkOption` with the package
type, to be `mkPackageOption`, in order to reduce the amount of code.
2023-11-27 01:28:36 +01:00
Jonathan Davies
a1163912c2 nixos/caddy: Fixed RestartSec typo. 2023-11-24 11:03:32 +00:00
Emily
1f9a04da3f
Merge pull request #265465 from jpds/caddy-restart-on-failure
nixos/caddy: Set systemd unit to restart on-failure
2023-11-19 23:59:20 +01:00
Mario Rodas
d3deaacfb4
Merge pull request #263550 from anthonyroussel/updates/axis2
axis2: 1.7.9 -> 1.8.2, tomcat10: 10.0.27 -> 10.1.15, tomcat9: 9.0.75 -> 9.0.82
2023-11-19 09:39:19 -05:00
Ryan Lahfa
ccfe07c316
Merge pull request #266270 from Ma27/postgresql-ownership-15 2023-11-17 18:02:17 +01:00
Maximilian Bosch
48459567ae nixos/postgresql: drop ensurePermissions, fix ensureUsers for postgresql15
Closes #216989

First of all, a bit of context: in PostgreSQL, newly created users don't
have the CREATE privilege on the public schema of a database even with
`ALL PRIVILEGES` granted via `ensurePermissions` which is how most of
the DB users are currently set up "declaratively"[1]. This means e.g. a
freshly deployed Nextcloud service will break early because Nextcloud
itself cannot CREATE any tables in the public schema anymore.

The other issue here is that `ensurePermissions` is a mere hack. It's
effectively a mixture of SQL code (e.g. `DATABASE foo` is relying on how
a value is substituted in a query. You'd have to parse a subset of SQL
to actually know which object are permissions granted to for a user).

After analyzing the existing modules I realized that in every case with
a single exception[2] the UNIX system user is equal to the db user is
equal to the db name and I don't see a compelling reason why people
would change that in 99% of the cases. In fact, some modules would even
break if you'd change that because the declarations of the system user &
the db user are mixed up[3].

So I decided to go with something new which restricts the ways to use
`ensure*` options rather than expanding those[4]. Effectively this means
that

* The DB user _must_ be equal to the DB name.
* Permissions are granted via `ensureDBOwnerhip` for an attribute-set in
  `ensureUsers`. That way, the user is actually the owner and can
  perform `CREATE`.
* For such a postgres user, a database must be declared in
  `ensureDatabases`.

For anything else, a custom state management should be implemented. This
can either be `initialScript`, doing it manual, outside of the module or
by implementing proper state management for postgresql[5], but the
current state of `ensure*` isn't even declarative, but a convergent tool
which is what Nix actually claims to _not_ do.

Regarding existing setups: there are effectively two options:

* Leave everything as-is (assuming that system user == db user == db
  name): then the DB user will automatically become the DB owner and
  everything else stays the same.

* Drop the `createDatabase = true;` declarations: nothing will change
  because a removal of `ensure*` statements is ignored, so it doesn't
  matter at all whether this option is kept after the first deploy (and
  later on you'd usually restore from backups anyways).

  The DB user isn't the owner of the DB then, but for an existing setup
  this is irrelevant because CREATE on the public schema isn't revoked
  from existing users (only not granted for new users).

[1] not really declarative though because removals of these statements
    are simply ignored for instance: https://github.com/NixOS/nixpkgs/issues/206467
[2] `services.invidious`: I removed the `ensure*` part temporarily
    because it IMHO falls into the category "manage the state on your
    own" (see the commit message). See also
    https://github.com/NixOS/nixpkgs/pull/265857
[3] e.g. roundcube had `"DATABASE ${cfg.database.username}" = "ALL PRIVILEGES";`
[4] As opposed to other changes that are considered a potential fix, but
    also add more things like collation for DBs or passwords that are
    _never_ touched again when changing those.
[5] As suggested in e.g. https://github.com/NixOS/nixpkgs/issues/206467
2023-11-13 17:16:25 +01:00