Commit graph

818 commits

Author SHA1 Message Date
Robert Rose 3701d859ae foundationdb: mark cross-compiling as broken 2025-01-24 09:44:58 +01:00
Niklas Korz d223d3f15d nixos/mongodb: add pkgs.mongodb-ce as package option example 2025-01-21 18:25:39 +01:00
Niklas Korz 2f8af3ea93 nixos/mongodb: replace option initialRootPassword with initialRootPasswordFile 2025-01-21 18:25:39 +01:00
Niklas Korz 3f8a2242b2 nixos/mongodb: use mongosh instead of legacy shell 2025-01-21 18:25:39 +01:00
Maximilian Bosch c1bf44ab55
Merge: nixos/postgresql: fix condition for readwritepaths (#372164) 2025-01-19 12:32:13 +01:00
Minijackson 08f182057f
nixos/ferretdb: disable telemetry by default 2025-01-14 10:38:24 +01:00
Minijackson 3b3764df09
nixos/ferretdb: set default value for PostgreSQL URL
provides a nice default if the end user wants to use the PostgreSQL
backend
2025-01-14 10:38:23 +01:00
Minijackson ccd19c4503
nixos/ferretdb: move default settings to options
so that they are documented in the options list
2025-01-14 10:38:22 +01:00
Sandro 641122c422
nixos/neo4j: add advertisedAddress options (#364250) 2025-01-12 21:40:11 +01:00
Martin Weinelt 4d0f802848
nixos/postgresql: fix condition for readwritepaths
In the case that the user wants to provide a custom data directory, we
need to grant `ReadWritePaths` for that directory. Previously this would
not happen when `/var/lib/postgresql` was used, because the condition
was not in fact checking for the default data directory, creating a gap
in then if-else scenario.

Fixes: #371680
2025-01-08 16:08:46 +01:00
piegames dd7d5339f7 treewide: Fix incorrect string indentations 2025-01-07 19:49:28 +01:00
Emily c1f8b214cc foundationdb: 7.1.32 -> 7.3.42
Includes fixes for GCC 14 and using non‐vendored libraries.
2024-12-30 12:35:07 +00:00
Arne Keller 0d9ea99d72
nixos/couchdb: Add support for additional config files (#358006) 2024-12-13 08:58:39 +01:00
Defelo 59ebd72118
nixos/neo4j: add advertisedAddress options 2024-12-12 22:37:15 +01:00
Tom Hubrecht 0bdb7a72b1
nixos/postgresql: Add finalPackage attribute
This allows refering to the actual installed package, which is necessary
when using plugins and wanting to use postgres in scripts
2024-12-12 16:54:06 +01:00
Maximilian Bosch 51a6938a44
nixos/doc: document how to allow-list tablespaces
It was brought up that the restricted file-system access breaks
tablespaces[1]. I'd argue that this is the desired behavior, the whole
point of the hardening is the lock the service down and I don't consider
tablespaces common enough to elevate privileges again. Especially since
the workaround is trivial as shown in the diff.

For completeness sake, this adds the necessary `ReadWritePaths` change
to the postgresql section of the manual.

This also adds a small correction about the state of
`ensurePermissions`.

[1] https://github.com/NixOS/nixpkgs/pull/344925#issuecomment-2521188907
2024-12-12 13:42:52 +01:00
Mike Kusold aed11df8a5 nixos/couchdb: Convert extraConfig to follow RFC42 2024-12-11 23:15:50 -07:00
Mike Kusold 82e0c6257a nixos/couchdb: Add support for additional config files
This allows users to set the Admin Password via secrets. `configFile` must be writable which is why it isn't sufficient.
nixfmt nixos/modules/services/databases/couchdb.nix
2024-12-11 23:11:08 -07:00
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00
Andrew Frahn c146818be2 nixos/services.redis: complete removal of with lib; 2024-12-10 16:19:03 +11:00
Felix Buehler db321b974a nixos/services.redis: remove with lib; 2024-12-08 13:21:51 +01:00
Felix Buehler 36828aceef nixos/services.mongodb: remove with lib; 2024-12-08 13:21:51 +01:00
Felix Buehler 035c17d408 nixos/services.monetdb: remove with lib; 2024-12-08 13:21:51 +01:00
Felix Buehler 261e4890fb nixos/services.memcached: remove with lib; 2024-12-08 13:21:51 +01:00
Felix Buehler 3aa36dd181 nixos/services.cockroachdb: remove with lib; 2024-12-08 13:21:51 +01:00
Felix Buehler fa6f1e3ce5 nixos/services.clickhouse: remove with lib; 2024-12-08 13:21:51 +01:00
Felix Buehler f6ebc4cfe0 nixos/services.aerospike: remove with lib; 2024-12-08 13:21:51 +01:00
nicoo ce799c73e5 nixos/influxdb: Replace custom drv with pkgs.formats.toml 2024-12-04 20:43:19 +00:00
Ryan Yin 534b77f858 nixos/victoriametrics: the prometheusConfig option isn't null by default 2024-12-04 22:54:29 +08:00
Maximilian Bosch c055f6bc0a
nixos/mysql: fix evaluation of percona test
Commit e14483d6a6 fixed a bug in the `ini`
type with `listsAsDuplicatedKeys = true;`: multiple list declarations
weren't merged, but latter declarations shadowed the former without any
error.

The fix brought another issue to surface however: before, the
`plugin-load-add` declaration in the MySQL test shadowed the
`auth_socket.so` setting in the module. But now the attempt
to merge a list and a single declaration breaks because of
`types.either` seeing a mix of declarations from the left
AND right type.

Turning the `plugin-load-add` in the module into a list triggers the
correct merging behavior and thus fixes the evaluation error (and
merging behavior of `plugin-load-add`)!

This wasn't an issue for mysql itself (empty `plugin-load-add` in the
test) and neither for mariadb (the `auth_socket.so` isn't added for
this).
2024-11-29 21:55:49 +01:00
Maximilian Bosch 4220a62d70
Merge: nixos/victoriametrics: check config, more tests & update desc (#353950) 2024-11-24 14:18:29 +01:00
Maximilian Bosch 0c8d661707
Merge: nixos/pgbouncer: rework RFC42 integration (#356965) 2024-11-23 09:20:09 +01:00
Ryan Yin ad06fc936d nixos/victoriametrics: check config, more tests, update desc 2024-11-23 01:19:11 +08:00
Maximilian Bosch 2995b3825e
nixos/pgbouncer: rework RFC42 integration
Commit bfb9d1825d added RFC42 support
which is a good thing in general, but this implementation has the
following flaws:

* `services.pgbouncer.logFile` was not renamed to `[...].log_file`, but
  to `[...].logfile`. Also the use of `mkRenamedOptionModule` is
  inappropriate here because the two options are not equivalent: the old
  option took a path relative to the home directory, the new an absolute
  path.

* Using `mkRenamedOptionModule` with options that don't exist (but are
  keys in a freeform attr-set or an `attrsOf X`), you get the following
  error when referencing an option you didn't declare:

    error: evaluation aborted with the following error message: 'Renaming error: option `services.pgbouncer.settings.pgbouncer.listen_port' does not exist.'

  This error is pretty bad because it's not actionable for an end-user of
  the module. A possible use-case is doing

    networking.firewall.allowedTCPPorts = [ config.services.pgbouncer.listenPort ];

  without specifying a custom listen port. This is an example of why you
  want to keep options, they already contain defaults and you can re-use
  those defaults in other parts of your system configuration.

  I decided to re-add a bunch of options where I figured that it's
  either useful to be able to address those in the NixOS configuration
  or having documentation directly in the options' reference in the
  NixOS manual.

  I didn't add all options, I'll leave that to the maintainers of
  pgbouncer.
2024-11-22 17:01:36 +01:00
Sandro 3156de49ba
nixos/postgresql: update docs with extraPlugins to extensions rename 2024-11-22 15:48:08 +01:00
Ian Kerins 307090125f
nixos/postgresql: fix warning typo 2024-11-16 20:59:04 -05:00
Maximilian Bosch 97a911e8fb
Merge: nixos/postgresql: extension based hardening relaxation (#355010) 2024-11-16 22:29:36 +01:00
Martin Weinelt d370af0785
nixos/postgresql: create infrastructure for relaxing systemd hardening
By matching on the package names of the plugins passed into the package
we can relax the systemd unit hardening as needed.
2024-11-16 17:29:34 +01:00
Martin Weinelt 223a6c6ed0
nixos/postgresql: rename extraPlugins to extensions
This is the upstream lingo, and it makes everything slightly less
confusing.
2024-11-16 14:46:16 +01:00
Maximilian Bosch 0b3eef7441
postgresql_12: remove
This will be EOL at the end of November, so there's little reason to
keep it in 24.11[1]. As discussed, we'd like to keep it for as long as
possible to make sure there's a state in nixpkgs that has the latest
minor of postgresql_12 available with the most recent CVEs fixed for
people who cannot upgrade[2].

This aspect has been made explicit in the manual now for the next .11
release.

During the discussions it has been brought up that if people just do
`services.postgresql.enable = true;` and let the code decide the
postgresql version based on `system.stateVersion`, there's a chance that
such EOL dates will be missed. To make this harder, a warning will now
be raised when using the stateVersion-condition and the oldest still
available major is selected.

Additionally regrouped the postgresql things in the release notes to
make sure these are all shown consecutively. Otherwise it's a little
hard to keep track of all the changes made to postgresql in 24.11.

[1] https://endoflife.date/postgresql
[2] https://github.com/NixOS/nixpkgs/pull/353158#issuecomment-2453056692
2024-11-15 09:17:06 +01:00
Aleksana dbed5a6265
nixos/mysql: fix permission error during first startup (#331296) 2024-11-11 18:49:32 +08:00
Yorick 12eedc8e88
nixos/victoriametrics: harden systemd unit, add more options. (#350737) 2024-11-05 13:36:19 +01:00
Maximilian Bosch 500d745e73
Merge: nixos/postgresql: set up sandboxing (#344925) 2024-11-02 11:12:15 +01:00
Maximilian Bosch 70a6092f1e
nixos/doc: mention postgresql hardening 2024-11-01 16:31:35 +01:00
Collin Diekvoss 1b82e17fca
Update surrealdb options for v2 2024-10-31 13:12:53 -05:00
Ryan Yin 89b4cb7299 nixos/victoriametrics: harden systemd unit, add more options. 2024-10-31 23:47:02 +08:00
Atemu 644c36174b
nixos/redis: add option services.redis.servers.*.group (#345327) 2024-10-17 10:39:48 +02:00
Felix Bühler cc42a1be7b
nixos/services.mysql: remove with lib; (#338048) 2024-10-16 21:38:48 +02:00
Maximilian Bosch 0f1e2a1cd8
nixos/postgresql: MemoryDenyWriteExecute must be off when doing JIT
The test breaks like this otherwise:

    machine # WARNING:  error during JITing: Permission denied
    machine # [   14.012280] postgres[913]: [913] WARNING:  error during JITing: Permission denied
    machine # ERROR:  failed to look up symbol "evalexpr_0_1": Failed to materialize symbols: { (main, { evalexpr_0_1, evalexpr_0_0 }) }
2024-10-14 23:57:39 +02:00
Brendan Taylor cb31bd4755 nixos/redis: add option services.redis.servers.*.group
previously if you set the "user" option and did not create a group
account with the same name the module would create a service that would
fail to start.

with this change:
- the module is more explicit about this behaviour
- you can configure the group directly, so that you're not forced to a
  particular user/group structure
- you can read the group name used by the redis service. this is useful
  for giving other services permission to use the redis socket.
2024-10-04 21:12:38 -06:00
Maximilian Bosch f800d8e42b
nixos/postgresql: enable private /tmp & private mounts; fix wal-receiver test
The issue was that the old test-case used `/tmp` to share data. Using
`JoinsNamespaceOf=` wasn't a real workaround since the private `/tmp` is
recreated when a service gets stopped/started which is the case here, so
the wals were still lost.

To keep the test building with `PrivateTmp=yes`, create a dedicated
directory in `/var/cache` with tmpfiles and allow the hardened
`postgresql.service` to access it via `ReadWritePaths`.
2024-10-01 10:31:20 +02:00
Martin Weinelt 2ebffcc4c7
nixos/postgresql: set up sandboxing
Reduces the general exposure of the postgresql.service through systemd
hardening options.
2024-10-01 10:31:20 +02:00
Maximilian Bosch 11d1f8776c
nixos/postgresql: escape initdbArgs
It doesn't look correct that this isn't the case already.
2024-09-29 21:03:52 +02:00
Maximilian Bosch 0e78dc369c
Merge: doc: use initdbArgs in example postgresql upgrade script (#302823) 2024-09-29 20:39:05 +02:00
oddlama d229011025 nixos/influxdb2: fix service startup reliablility 2024-09-27 08:14:27 +02:00
Bjørn Forsman 732d36522f nixos/influxdb2: wait until service is ready
Factor out part of the provisioning script into a
wait-until-service-is-ready script, and put it unconditionally in
front of ExecStartPost=, so that services that depend on influxdb2 are
not started until influxdb2 responds to requests.

Fixes https://github.com/NixOS/nixpkgs/issues/317017 ("Scrutiny tries to start before influxdb has started")
2024-09-26 06:54:54 +02:00
Daniel Sidhion 15ddcc64cd
nixos/tigerbeetle: add docs on upgrading, add more systemd hardening (#332899) 2024-09-24 23:56:38 -07:00
Sandro 76d7694a3f
nixos/neo4j: always set http values, even when disabled (#341586) 2024-09-15 12:42:20 +02:00
Felix Buehler 7d32787294 nixos/services.etcd: remove with lib; 2024-09-15 10:43:48 +02:00
eyjhb 7c545e26a3 nixos/neo4j: always set http values, even when disabled 2024-09-13 15:22:34 +02:00
github-actions[bot] d834278999
Merge master into staging-next 2024-09-02 00:13:57 +00:00
Felix Bühler 06aee405da
nixos/services.neo4j: remove with lib; (#338049) 2024-09-01 20:52:52 +02:00
github-actions[bot] a2cea72749
Merge staging-next into staging 2024-08-30 00:13:56 +00:00
Philip Taron 117f3ceb51
treewide/nixos: remove with lib; part 1 (#335603) 2024-08-29 15:42:04 -07:00
Felix Buehler 24f82fc6b5 nixos/services.surrealdb: remove with lib; 2024-08-30 00:30:41 +02:00
Felix Buehler edcd08a8ff nixos/services.rethinkdb: remove with lib; 2024-08-30 00:30:41 +02:00
Felix Buehler 18c0ca5714 nixos/services.pgmanage: remove with lib; 2024-08-30 00:30:41 +02:00
Felix Buehler 6bbc3df0dd nixos/services.opentsdb: remove with lib; 2024-08-30 00:30:40 +02:00
Felix Buehler 93fb328e44 nixos/services.openldap: remove with lib; 2024-08-30 00:30:40 +02:00
Felix Buehler 0dbb2e5fa1 nixos/services.influxdb: remove with lib; 2024-08-30 00:30:40 +02:00
Felix Buehler 3db1445493 nixos/services.hbase-standalone: remove with lib; 2024-08-30 00:30:40 +02:00
Felix Buehler 567aa06ba2 nixos/services.firebird: remove with lib; 2024-08-30 00:30:40 +02:00
Felix Buehler 17003eacc9 nixos/services.ferretdb: remove with lib; 2024-08-30 00:30:39 +02:00
Felix Buehler f06f3a7973 nixos/services.dragonflydb: remove with lib; 2024-08-30 00:30:39 +02:00
Felix Buehler 626c4c1a21 nixos/services.dgraph: remove with lib; 2024-08-30 00:30:39 +02:00
Felix Buehler 75d565a3b0 nixos/services.couchdb: remove with lib; 2024-08-30 00:30:39 +02:00
Felix Buehler be15d06e48 nixos/services.neo4j: remove with lib; 2024-08-29 00:21:21 +02:00
Felix Buehler 8e91c6b7b3 nixos/services.mysql: remove with lib; 2024-08-29 00:20:49 +02:00
Felix Buehler fbd927db77 nixos/services.foundationdb: remove with lib; 2024-08-29 00:20:04 +02:00
Sergei Trofimovich f3ece34945 nixos/postgresql: fix documentation markdown
Without the change the doc build fails as:

    $ nix build -f nixos config.system.build.manual.manualHTML -L
    ...
    nixos-manual-html> RuntimeError: heading in line 366 does not have an id
2024-08-25 17:09:36 +01:00
Wolfgang Walther 435f51c37f
postgresql: split dev output
This splits a dev output to make the default output not depend on any
build dependencies anymore. This also avoids removing references from
pgxs' Makefile this way, which should, at least theoretically, be good
to build extensions via pgxs, making sure they use the same tooling.

ecpg is the "embedded SQL C preprocessor", which is certainly a dev
tool.

Most important, for closure size anyway, is to move pg_config to the dev
output, since it retains paths to all the other outputs.

The only thing with references to the dev output remaining is then the
postgres binary itself. It contains all the output paths, because it
shows those in the pg_config system view. There is no other way than
to nuke those references to avoid circular dependencies between outputs
- and blowing up closure size again.
2024-08-23 21:37:49 +02:00
Pol Dellaiera 8d18fe9184
Merge pull request #335151 from drupol/nixos/chromadb/init
nixos/chromadb: init
2024-08-19 17:29:57 +02:00
Sandro c67dbda54f
Merge pull request #308700 from tie/pgbouncer-settings
nixos/pgbouncer: add services.pgbouncer.settings option
2024-08-18 16:30:17 +02:00
Pol Dellaiera 835b2f8822
nixos/chromadb: init 2024-08-16 18:23:12 +02:00
github-actions[bot] d3ef01201e
Merge master into staging-next 2024-08-08 18:01:35 +00:00
Sandro Jäckel 3e8666bce9 nixos/redis: remove outdated info in enable option
Thanks for the heads up @poperigby !
2024-08-08 17:25:16 +02:00
Ivan Trubach bfb9d1825d nixos/pgbouncer: add services.pgbouncer.settings option
This change adds services.pgbouncer.settings option as per [RFC 0042]
and deprecates other options that were previously used to generate
configuration file.

In addition to that, we also place the configuration file under
environment.etc to allow reloading configuration without service
restart.

[RFC 0042]: https://github.com/NixOS/rfcs/blob/master/rfcs/0042-config-option.md
2024-08-08 05:54:26 +03:00
Maximilian Bosch 7b01c5da3c
Merge pull request #329611 from Ma27/pg16
postgresql: 15 -> 16 for 24.11+
2024-08-02 07:09:50 +00:00
Felix Uhl 10538b82df nixos/mysql: fix permission error during first startup
When mysql starts up for the first time, the binary `mysql_install_db`
will run and try to set up the correct folder structure and permissions.

The very first step is to change the owner and group of the data
directory. This can fail in some cases, for example if `cfg.dataDir` is
something like `/mnt/mysql`:

```
Jul 31 15:24:35 junction systemd[1]: Starting MySQL Server...
Jul 31 15:24:36 junction mysql-pre-start[1346]: chown: changing ownership of '/mnt/mysql': Operation not permitted
Jul 31 15:24:36 junction mysql-pre-start[1309]: Cannot change ownership of the database directories to the 'mysql'
Jul 31 15:24:36 junction mysql-pre-start[1309]: user.  Check that you have the necessary permissions and try again.
Jul 31 15:24:36 junction systemd[1]: mysql.service: Control process exited, code=exited, status=1/FAILURE
Jul 31 15:24:36 junction systemd[1]: mysql.service: Failed with result 'exit-code'.
Jul 31 15:24:36 junction systemd[1]: Failed to start MySQL Server.
```

This is because `/mnt` usually is owned by root.

To work around this issue, use `systemd.tmpfiles` to set the owner,
group and permissions. This will always work, and if the permissions are
already set as expected, mysql will not try to alter them again.
2024-07-31 15:49:23 +02:00
Sigmanificient 543cd40ecc treewide: remove trailing space in description
Done using `grep -rP 'description\s+=\s+"[^"]+[ ]";' | cut -d ':' -f 1 |
xargs -i nvim {}` and sorting the opened files by hand, avoiding
generated packages list
2024-07-26 03:38:50 +02:00
Maximilian Bosch bf2d040432
postgresql: 15 -> 16 for 24.11+
Upgrade default postgresql for stateVersion >=24.11.
This also rebuilds all packages linking against `libpq.so` to use
postgresql 16.

After re-reading https://www.postgresql.org/docs/16/release-16.html
I don't see any major risks about doing that.
2024-07-24 10:43:02 +02:00
Michael Weiss 10cbea2905
nixos/monetdb, nixos/sks: remove primeos from maintainers (#277366)
Remove myself as maintainer from modules that I don't use anymore
2024-07-04 18:17:43 +02:00
Sandro 33f83c6252
Merge pull request #316977 from eclairevoyant/fix-mkEnableOption
treewide: fix mkEnableOption usage
2024-06-25 22:42:16 +02:00
Paul Meyer fbe8538aa1 treewide: remove jonringer as package maintainer
Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com>
2024-06-25 09:16:56 +02:00
Wolfgang Walther 0487937af3
postgresql: add readme with eol-policy
This was discussed and agreed on in [1].

[1]: https://github.com/NixOS/nixpkgs/pull/310580#discussion_r1597284693
2024-06-14 09:38:23 +02:00
éclairevoyant 7d8742da87
treewide: fix mkEnableOption usage 2024-06-14 02:41:42 -04:00
github-actions[bot] 67f8ba4a30
Merge master into staging-next 2024-05-01 18:01:22 +00:00
Tom Hubrecht 0ccd40450f nixos/postgresql: Remove toplevel with lib; 2024-05-01 12:25:24 +02:00
github-actions[bot] 6fecc628f9
Merge master into staging-next 2024-04-29 12:01:15 +00:00
Sandro Jäckel 5f349abc7b
nixos/redis: don't disable transparent hugepages
Since https://github.com/redis/redis/pull/4001 included in 6.2.0
transparent hugepages works when being set to madvise which is the NixOS
and upstream recommended default.
2024-04-28 21:17:03 +02:00