Hey Nix-ers,
I’m trying to set up a personal Nostr relay with Strfry. If I don’t configure a plugin to limit spam & bots, it works normally. If I do configure it, I get in the logs
Setting up write policy plugin: /var/lib/nostr/write-policy.py ERR| Couldn't setup plugin: posix_spawn failed to invoke '/var/lib/nostr/write-policy.py': No such file or directory
The plugin is obviously there, it works, it’s executable by strfry user, the path to get to it is accessible to strfry user etc. Long story short
sudo -u strfry /var/lib/nostr/write-policy.py
works normally as it should.
If I manually run the strfry command line to starts the service (with the appropriate user), e.g.
sudo -u strfry /nix/store/.../bin/strfry --config=/nix/store/...config.json relay
as I get from systemctl status strfry.service it’s working correctly, the plugin got executed normally. I have a feeling that somehow systemd is blocking the execution of separate process (ps aux | grep strfry when I run it manually shows 4 processes, one of which is the little write-policy.py script, whereas via systemd there’s only one process), but my knowledge of Nix/NixOS isn’t enough to understand what limitation this might be if my hunch is correct, or what else it could be otherwise.
(not much) relevant NixOS config is
service.strfry = {
#... all the settings
writePolicy.plugin = "/var/lib/nostr/write-policy.py";
};
The module is nixpkgs/nixos/modules/services/web-apps/strfry.nix at e576e3c9cf9bad747afcddd9e34f51d18c855b4e · NixOS/nixpkgs · GitHub
Does anyone have any ideas?