From c89d3b6b3646b707b53146226bb7afd21cca11fa Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Sun, 11 Jan 2026 21:01:20 +0000 Subject: 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. --- nix/module.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 # Command to run ExecStart = if cfg.relayOwnerNsecFile != null then # Use nsec from file - need to use shell to read the file - "${pkgs.bash}/bin/bash -c '${ngit-grasp}/bin/ngit-grasp --relay-owner-nsec \"$(cat ${cfg.relayOwnerNsecFile})\"'" + # Use tr to remove trailing newline which would invalidate the nsec + "${pkgs.bash}/bin/bash -c '${ngit-grasp}/bin/ngit-grasp --relay-owner-nsec \"$(cat ${cfg.relayOwnerNsecFile} | tr -d \"\\n\")\"'" else # Let ngit-grasp auto-generate nsec in .relay-owner.nsec file in dataDir "${ngit-grasp}/bin/ngit-grasp"; -- cgit v1.2.3