From 809982cdc78e287bc9f3fc0dbac5e2aab2fd7f7d Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Sun, 11 Jan 2026 21:07:33 +0000 Subject: fix(config): trim whitespace from relay-owner-nsec CLI/env input When relay_owner_nsec is provided via CLI argument or environment variable (e.g., read from a file by the NixOS module), trim any leading/trailing whitespace including newlines. This matches the behavior when reading from the .relay-owner.nsec file directly. Fixes issue where NixOS module reads nsec file with 'cat', which includes the trailing newline, making the nsec invalid when passed as a CLI argument. Also reverted the tr workaround in nix/module.nix since ngit-grasp now handles this correctly. --- nix/module.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'nix') diff --git a/nix/module.nix b/nix/module.nix index 60b8d5f..d820b67 100644 --- a/nix/module.nix +++ b/nix/module.nix @@ -245,8 +245,7 @@ let # Command to run ExecStart = if cfg.relayOwnerNsecFile != null then # Use nsec from file - need to use shell to read the file - # 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\")\"'" + "${pkgs.bash}/bin/bash -c '${ngit-grasp}/bin/ngit-grasp --relay-owner-nsec \"$(cat ${cfg.relayOwnerNsecFile})\"'" else # Let ngit-grasp auto-generate nsec in .relay-owner.nsec file in dataDir "${ngit-grasp}/bin/ngit-grasp"; -- cgit v1.2.3