thanks for the answers.
So I conclude what I want is not possible without copying the whole module…
Based on this thread and my experiences to try to get it to work, I think there are three separate issues. I don’t use Github, if anyone with Github account can copy/paste these into an issue, that would be great!
Issue 1. Module functions not in auto-generated documentation
Some important/often used library functions that used to define a NixOS configuration are not documented in the automatically generated manuals on nixos.org
For example, mkMerge, mkAfter, etc. are defined in modules.nix, and are nicely documented in the source code, but are not rendered in the HTML manuals.
Workaround:
As far as I know, the only way a regular NixOS user can read about these functions is to find the correct source file and read the source.
Issue 2. Policy to make service definitions extendable
Make it a generic policy for all modules to make options like ExecStartPre and others always mergable.
Not sure how to describe this correctly and what the procedure it to this (RFC?). See comments from @aanderse @tejing . I’ll leave it up to actual NixOS devs to decide if this is an issue or not.
Issue 3. When nitter service starts too early, it will not work
Perhaps for @erdnaxe to decide
This is specific to the Nitter module. If the systemd service starts before the network is fully up, Nitter will not be able to fetch a token.
and you will always get this message:
Instance has been rate limited.
Use another instance or try again later.
Possible solution:
Extende the ExecStartPre with something like:
systemd.services.nitter.serviceConfig.ExecStartPre = ''
${pkgs.busybox}/bin/sh -c '(while ! ${pkgs.busybox}/bin/nc -z -v -w1 twitter.com 443 2>/dev/null; do
echo "Waiting for Twitter to be reachable...";
sleep 2;
done); sleep 2'
''
or a nicer variant of this (a ‘Twitter-reachable’ target?)
Workaround:
systemctl restart nitter.service
Thanks everyone!