-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
60 changed files
with
1,540 additions
and
641 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3276,6 +3276,13 @@ | |
githubId = 355401; | ||
name = "Brian Hicks"; | ||
}; | ||
brianmay = { | ||
name = "Brian May"; | ||
email = "[email protected]"; | ||
github = "brianmay"; | ||
githubId = 112729; | ||
keys = [ { fingerprint = "D636 5126 A92D B560 C627 ACED 1784 577F 811F 6EAC"; } ]; | ||
}; | ||
brianmcgee = { | ||
name = "Brian McGee"; | ||
email = "[email protected]"; | ||
|
@@ -13662,6 +13669,12 @@ | |
githubId = 34819524; | ||
name = "Marcel"; | ||
}; | ||
MarchCraft = { | ||
email = "[email protected]"; | ||
github = "MarchCraft"; | ||
githubId = 30194994; | ||
name = "Felix Nilles"; | ||
}; | ||
marcovergueira = { | ||
email = "[email protected]"; | ||
github = "marcovergueira"; | ||
|
@@ -20424,6 +20437,12 @@ | |
name = "夜坂雅"; | ||
keys = [ { fingerprint = "3237 D49E 8F81 5A45 2133 64EA 4FF3 5790 F405 53A9"; } ]; | ||
}; | ||
shadows_withal = { | ||
email = "[email protected]"; | ||
github = "shadows-withal"; | ||
githubId = 6445316; | ||
name = "liv"; | ||
}; | ||
shahrukh330 = { | ||
email = "[email protected]"; | ||
github = "shahrukh330"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
{ | ||
config, | ||
pkgs, | ||
lib, | ||
... | ||
}: | ||
let | ||
cfg = config.services.nostr-rs-relay; | ||
settingsFormat = pkgs.formats.toml { }; | ||
configFile = settingsFormat.generate "config.toml" ( | ||
cfg.settings | ||
// { | ||
database = { | ||
data_directory = config.services.nostr-rs-relay.dataDir; | ||
}; | ||
network = { | ||
port = config.services.nostr-rs-relay.port; | ||
}; | ||
} | ||
); | ||
in | ||
{ | ||
options.services.nostr-rs-relay = { | ||
enable = lib.mkEnableOption "nostr-rs-relay"; | ||
|
||
package = lib.mkPackageOption pkgs "nostr-rs-relay" { }; | ||
|
||
port = lib.mkOption { | ||
default = 12849; | ||
type = lib.types.port; | ||
description = "Listen on this port."; | ||
}; | ||
|
||
dataDir = lib.mkOption { | ||
type = lib.types.path; | ||
default = "/var/lib/nostr-rs-relay"; | ||
description = "Directory for SQLite files."; | ||
}; | ||
|
||
settings = lib.mkOption { | ||
inherit (settingsFormat) type; | ||
default = { }; | ||
description = "See https://git.sr.ht/~gheartsfield/nostr-rs-relay/#configuration for documentation."; | ||
}; | ||
}; | ||
|
||
config = lib.mkIf cfg.enable { | ||
systemd.services.nostr-rs-relay = { | ||
description = "nostr-rs-relay"; | ||
wants = [ "network.target" ]; | ||
wantedBy = [ "multi-user.target" ]; | ||
|
||
serviceConfig = { | ||
ExecStart = "${cfg.package}/bin/nostr-rs-relay --config ${configFile}"; | ||
DynamicUser = true; | ||
Restart = "on-failure"; | ||
Type = "simple"; | ||
|
||
ReadWritePaths = [ cfg.dataDir ]; | ||
|
||
RuntimeDirectory = "nostr-rs-relay"; | ||
StateDirectory = "nostr-rs-relay"; | ||
|
||
PrivateTmp = true; | ||
PrivateUsers = true; | ||
PrivateDevices = true; | ||
ProtectSystem = "strict"; | ||
ProtectHome = true; | ||
NoNewPrivileges = true; | ||
MemoryDenyWriteExecute = true; | ||
ProtectKernelTunables = true; | ||
ProtectKernelModules = true; | ||
ProtectKernelLogs = true; | ||
ProtectClock = true; | ||
ProtectProc = "invisible"; | ||
ProcSubset = "pid"; | ||
ProtectControlGroups = true; | ||
LockPersonality = true; | ||
RestrictSUIDSGID = true; | ||
RemoveIPC = true; | ||
RestrictRealtime = true; | ||
ProtectHostname = true; | ||
CapabilityBoundingSet = ""; | ||
SystemCallFilter = [ | ||
"@system-service" | ||
]; | ||
SystemCallArchitectures = "native"; | ||
}; | ||
}; | ||
}; | ||
|
||
meta.maintainers = with lib.maintainers; [ | ||
felixzieger | ||
jb55 | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.