Go to file
Luflosi d4fcb44dcc
nixos/kubo: fix potential panic on startup
This fixes a panic of the kubo daemon which could occur under certain conditions when the daemon was starting.
It was caused by the `ipfs.service` unit not depending on the `ipfs-api.socket` and `ipfs-gateway.socket` units with `Wants=`. This allows the `ipfs.service` to be started manually or by `nixos-rebuild` without the sockets being set up before that. When that happens, the daemon won't know about these sockets and will only use what is set in `services.kubo.settings.Addresses.Gateway` and `services.kubo.settings.Addresses.API`. By default the `API` is an empty list in NixOS though. The daemon doesn't like this at all and panics on startup, see https://github.com/ipfs/kubo/issues/10056.
With this commit, starting `ipfs.service` will first set up the two sockets before starting the actual service.
Adding the `Sockets=` option implicitly adds a `Wants=` for the sockets and this is exactly what we need. See https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html#Implicit%20Dependencies . This can be checked with `systemctl show ipfs.service`.

This should probably be upstreamed to the unit file in the Kubo repo.

The problem can be reproduced in the following way:
- Add `services.kubo.enable = true` to `/etc/nixos/configuration.nix`
- `sudo nixos-rebuild switch` (this may already fail, not sure why it's not deterministic for me)
- `sudo systemctl stop ipfs-api.socket`
- `sudo systemctl stop ipfs-gateway.socket`
- `sudo systemctl stop ipfs.service`
- `sudo systemctl start ipfs.service`

Fixes #248447.
2023-12-15 23:36:08 +01:00
.github workflows/check-by-name: Cancel on merge conflicts 2023-12-15 18:49:29 +01:00
doc Merge pull request #273384 from nbraud/doc/system-state 2023-12-13 08:54:09 +01:00
lib lib.generators: made toLua accept derivations too 2023-12-15 15:05:46 +01:00
maintainers Merge pull request #273562 (add aws-gate package) 2023-12-14 23:25:18 +01:00
nixos nixos/kubo: fix potential panic on startup 2023-12-15 23:36:08 +01:00
pkgs signal-desktop: re-enable wayland 2023-12-15 22:49:30 +01:00
.editorconfig documentation-highlighter: 9.12.0 -> 11.9.0, add new langs 2023-12-02 00:07:26 +01: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 maintainers: stepbrobd change email and fingerprint 2023-12-06 13:07:16 -05:00
.version 24.05 is Uakari 2023-11-21 14:34:30 -05:00
CONTRIBUTING.md CONTRIBUTING.md: Dedent warnings until GitHub fixes it 2023-12-06 04:04:01 +01:00
COPYING COPYING: 2022 -> 2023 2023-01-01 13:23:08 +02:00
default.nix
flake.nix flake: drop libVersionInfoOverlay 2023-12-10 13:25:43 +01:00
README.md Release NixOS 23.11 2023-11-29 12:17:49 -05: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.