nixos/monero: add an option to use ip ban-list (#412522)

This commit is contained in:
Michele Guerini Rocco 2025-06-02 09:17:36 +02:00 committed by GitHub
commit 0e0842c978
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -32,6 +32,10 @@ let
restricted-rpc=1
''}
${lib.optionalString (banlist != null) ''
ban-list=${banlist}
''}
limit-rate-up=${toString limits.upload}
limit-rate-down=${toString limits.download}
max-concurrency=${toString limits.threads}
@ -64,6 +68,23 @@ in
'';
};
banlist = lib.mkOption {
type = lib.types.nullOr lib.types.path;
default = null;
description = ''
Path to a text file containing IPs to block.
Useful to prevent DDoS/deanonymization attacks.
https://github.com/monero-project/meta/issues/1124
'';
example = lib.literalExpression ''
builtins.fetchurl {
url = "https://raw.githubusercontent.com/rblaine95/monero-banlist/c6eb9413ddc777e7072d822f49923df0b2a94d88/block.txt";
hash = "";
};
'';
};
mining.enable = lib.mkOption {
type = lib.types.bool;
default = false;
@ -225,7 +246,7 @@ in
serviceConfig = {
User = "monero";
Group = "monero";
ExecStart = "${pkgs.monero-cli}/bin/monerod --config-file=${configFile} --non-interactive";
ExecStart = "${lib.getExe' pkgs.monero-cli "monerod"} --config-file=${configFile} --non-interactive";
Restart = "always";
SuccessExitStatus = [
0