NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
16.55k stars 13.04k forks source link

Documentation: akkoma federation policies chapter contains wrong example + typo #290406

Open Elinvention opened 4 months ago

Elinvention commented 4 months ago

Problem

https://nixos.org/manual/nixos/unstable/#modules-services-akkoma-federation-policies

In this chapter there is a proposed skeleton for :mrf_simple configuration, but it ignored by akkoma as is. Akkoma expects a list of tuples, while the proposed config uses an Elixir map.

There is also a typo in https://nixos.org/manual/nixos/unstable/#modules-services-akkoma-service-configuration where registration_open = false should be replaced by registrations_open = false (should I open a separate issue?).

Proposal

Replace mkMap { ... } with map mkTuple [ ... ]. For instance to reject all messages from example.com because of spam, do this:

reject = map mkTuple [
  ["example.com" "spam"]
];

instead of

reject = mkMap {
  "example.com" = "spam";
}

Using the configuration as proposed above, akkoma corretly loads the configuration and it is visible in nodeinfo.

Also, again, replace registration_open = false with registrations_open = false.

Checklist


Add a :+1: reaction to issues you find important.

cafkafk commented 1 month ago

Can confirm that the documentation's way of doing it doesn't work, and the map mkTuple does, glad I found this, I was so confused why I couldn't get MRF working :)