Add NixOS module options for deletion requests

This commit is contained in:
DanConwayDev
2026-01-14 10:22:39 +00:00
parent c8c385029e
commit b74a201d86
+26
View File
@@ -250,6 +250,29 @@ let
'';
};
deletionRequestDisrespector = mkOption {
type = types.bool;
default = false;
description = ''
Archival relay mode that ignores NIP-09 deletion requests.
When true, all deletion requests are ignored and events are retained permanently.
Prevents "left-pad" scenarios where critical code is deleted from the network.
Useful for archival relays that prioritize data preservation.
'';
};
archiveRetentionSecs = mkOption {
type = types.int;
default = 7776000;
description = ''
Archive retention period in seconds for deleted events and git data.
How long to keep archived events and git data before permanent deletion.
Default: 7776000 seconds (90 days).
Set to lower values for testing (e.g., 60 for 1 minute).
Has no effect if deletionRequestDisrespector is true (events never deleted).
'';
};
user = mkOption {
type = types.str;
default = "ngit-grasp-${name}";
@@ -295,6 +318,9 @@ let
NGIT_REPOSITORY_WHITELIST = concatStringsSep "," cfg.repositoryWhitelist;
NGIT_REPOSITORY_BLACKLIST = concatStringsSep "," cfg.repositoryBlacklist;
NGIT_EVENT_BLACKLIST = concatStringsSep "," cfg.eventBlacklist;
NGIT_DELETION_REQUEST_DISRESPECTOR =
if cfg.deletionRequestDisrespector then "true" else "false";
NGIT_ARCHIVE_RETENTION_SECS = toString cfg.archiveRetentionSecs;
RUST_LOG = cfg.logLevel;
} // optionalAttrs (cfg.relayName != null) {
NGIT_RELAY_NAME = cfg.relayName;