Go to file
Maximilian Bosch 7f08d0ebd8
nixos/matrix-synapse: drop old DB check assertion, actually require DB to be up
Closes #236062

The PR #236062 was submitted because of the following problem: a synapse
instance was running in a NixOS container attached to the host network
and a postgresql instance on the host as database. In this setup,
synapse connected to its DB via 127.0.0.1, but the DB wasn't locally set
up and thus not configured in NixOS (i.e.
`config.services.postgresql.enable` was `false`). This caused the
assertion removed in this patch to fail.

Over three years ago this assertion was introduced when this module
stopped doing autoconfiguration of postgresql entirely[1] because a
breaking change in synapse couldn't be managed via an auto-upgrade on
our side. To make sure people don't deploy their DB away by accident,
this assertion was introduced.

Nowadays this doesn't serve any value anymore because people with
existing instances should've upgraded by now (otherwise it's their job
to carefully read the release notes when missing upgrades for
several years) and people deploying fresh instances are instructed by
the docs to also configure postgresql[2].

Instead, it only causes issues in corner cases like #236062, so after
some discussion in that PR I think it's time to remove the assertion
altogether.

Also, there's no `Requires=` for `postgresql.service` in the systemd
units which means that it's not strictly guaranteed that the DB is up
when synapse starts up. This is fixed now by adding `requires`. To avoid
being bitten by above mentioned cases again, this only happens if
`config.services.postgresql.enable` is `true`.

If somebody uses a non-local postgresql, but has also deployed a local
postgresql instance on the synapse server (rather unlikely IMHO), it's
their job to opt out of this behavior with `mkForce` (this is precisely one
of the use-cases `mkForce` and friends were built for IMHO).

[1] https://github.com/NixOS/nixpkgs/pull/80447
[2] https://nixos.org/manual/nixos/stable/#module-services-matrix-synapse
2023-10-09 14:06:50 +02:00
.github Merge pull request #259074 from tweag/detect-merge-conflicts 2023-10-06 05:09:54 +02:00
doc Merge pull request #258384 from doronbehar/buildNpmPackage-makeWrapperArgs 2023-10-08 12:38:33 +03:00
lib licenses: add Anti-Capitalist Software License v1.4 2023-10-05 19:33:49 +00:00
maintainers Merge pull request #258711 from allusive-dev/picom-allusive 2023-10-09 01:51:20 -04:00
nixos nixos/matrix-synapse: drop old DB check assertion, actually require DB to be up 2023-10-09 14:06:50 +02:00
pkgs plasma5Packages.kio: use a better homepage 2023-10-09 10:32:10 +00:00
.editorconfig lib.toPlist: keep test output in external files for their tab indents 2023-03-27 19:25:52 +02:00
.git-blame-ignore-revs git-blame-ignore-revs: add large docs migrations 2023-07-03 02:28:08 +02:00
.gitattributes .gitattributes: fix typo 2023-05-01 12:30:00 +02:00
.gitignore gitignore: add .nixos-test-history produced by test driver (#258456) 2023-10-01 22:44:49 +02:00
.mailmap mailmap: cleanup shortlog stats for nixos-22.11 release 2022-12-02 13:01:53 +01:00
.version 23.11 is Tapir 2023-05-22 21:16:04 +02:00
CONTRIBUTING.md CONTRIBUTING.md: Reword changes acceptable for backport 2023-09-06 20:12:50 +02:00
COPYING COPYING: 2022 -> 2023 2023-01-01 13:23:08 +02:00
default.nix
flake.nix nixosModules.pkgsReadOnly: init 2023-05-10 15:55:09 +02:00
README.md README.md: Rough move to new contribution doc files 2023-08-13 21:54:50 +02:00

NixOS logo NixOS logo

Contributors badge Open Collective supporters

Nixpkgs is a collection of over 80,000 software packages that can be installed with the Nix package manager. It also implements NixOS, a purely-functional Linux distribution.

Manuals

  • NixOS Manual - how to install, configure, and maintain a purely-functional Linux distribution
  • Nixpkgs Manual - contributing to Nixpkgs and using programming-language-specific Nix expressions
  • Nix Package Manager Manual - how to write Nix expressions (programs), and how to use Nix command line tools

Community

Other Project Repositories

The sources of all official Nix-related projects are in the NixOS organization on GitHub. Here are some of the main ones:

  • Nix - the purely functional package manager
  • NixOps - the tool to remotely deploy NixOS machines
  • nixos-hardware - NixOS profiles to optimize settings for different hardware
  • Nix RFCs - the formal process for making substantial changes to the community
  • NixOS homepage - the NixOS.org website
  • hydra - our continuous integration system
  • NixOS Artwork - NixOS artwork

Continuous Integration and Distribution

Nixpkgs and NixOS are built and tested by our continuous integration system, Hydra.

Artifacts successfully built with Hydra are published to cache at https://cache.nixos.org/. When successful build and test criteria are met, the Nixpkgs expressions are distributed via Nix channels.

Contributing

Nixpkgs is among the most active projects on GitHub. While thousands of open issues and pull requests might seem a lot at first, it helps consider it in the context of the scope of the project. Nixpkgs describes how to build tens of thousands of pieces of software and implements a Linux distribution. The GitHub Insights page gives a sense of the project activity.

Community contributions are always welcome through GitHub Issues and Pull Requests.

For more information about contributing to the project, please visit the contributing page.

Donations

The infrastructure for NixOS and related projects is maintained by a nonprofit organization, the NixOS Foundation. To ensure the continuity and expansion of the NixOS infrastructure, we are looking for donations to our organization.

You can donate to the NixOS foundation through SEPA bank transfers or by using Open Collective:

License

Nixpkgs is licensed under the MIT License.

Note: MIT license does not apply to the packages built by Nixpkgs, merely to the files in this repository (the Nix expressions, build scripts, NixOS modules, etc.). It also might not apply to patches included in Nixpkgs, which may be derivative works of the packages to which they apply. The aforementioned artifacts are all covered by the licenses of the respective packages.