upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/nix
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2026-01-11 21:01:20 +0000
committerDanConwayDev <DanConwayDev@protonmail.com>2026-01-11 21:01:20 +0000
commitc89d3b6b3646b707b53146226bb7afd21cca11fa (patch)
tree6fb25cd987e7026c9add5494feef44f0db5c76a6 /nix
parent73648864e126bb62e5c0bfdea1a22b4b3f6cb9a6 (diff)
fix(nix): strip trailing newline from relay-owner-nsec file
When reading the nsec from a file, strip any trailing newline characters that would invalidate the nsec string. Use tr -d to remove all newline characters from the file content before passing to ngit-grasp.
Diffstat (limited to 'nix')
-rw-r--r--nix/module.nix3
1 files changed, 2 insertions, 1 deletions
diff --git a/nix/module.nix b/nix/module.nix
index d820b67..60b8d5f 100644
--- a/nix/module.nix
+++ b/nix/module.nix
@@ -245,7 +245,8 @@ let
245 # Command to run 245 # Command to run
246 ExecStart = if cfg.relayOwnerNsecFile != null then 246 ExecStart = if cfg.relayOwnerNsecFile != null then
247 # Use nsec from file - need to use shell to read the file 247 # Use nsec from file - need to use shell to read the file
248 "${pkgs.bash}/bin/bash -c '${ngit-grasp}/bin/ngit-grasp --relay-owner-nsec \"$(cat ${cfg.relayOwnerNsecFile})\"'" 248 # Use tr to remove trailing newline which would invalidate the nsec
249 "${pkgs.bash}/bin/bash -c '${ngit-grasp}/bin/ngit-grasp --relay-owner-nsec \"$(cat ${cfg.relayOwnerNsecFile} | tr -d \"\\n\")\"'"
249 else 250 else
250 # Let ngit-grasp auto-generate nsec in .relay-owner.nsec file in dataDir 251 # Let ngit-grasp auto-generate nsec in .relay-owner.nsec file in dataDir
251 "${ngit-grasp}/bin/ngit-grasp"; 252 "${ngit-grasp}/bin/ngit-grasp";