diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-11 20:40:38 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-11 20:40:38 +0000 |
| commit | 646dcf857f839ee42caa57a4e228d94d8efd79e4 (patch) | |
| tree | b4ec2060e0e3cfc8d245ee2908aef3e02cdbde42 /nix | |
| parent | 8acee2bfcba948f4b5a88709a047e6468394ca88 (diff) | |
fix(nix): wrap relay-owner-nsec file read in bash shell for systemd
systemd's ExecStart doesn't execute shell commands by default, so the
command substitution was being passed literally to ngit-grasp
instead of being evaluated. This caused a panic at startup when using
relayOwnerNsecFile option.
Wrap the command in bash -c to properly execute the file read.
Diffstat (limited to 'nix')
| -rw-r--r-- | nix/module.nix | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nix/module.nix b/nix/module.nix index a175639..8136ae1 100644 --- a/nix/module.nix +++ b/nix/module.nix | |||
| @@ -241,8 +241,8 @@ let | |||
| 241 | 241 | ||
| 242 | # Command to run | 242 | # Command to run |
| 243 | ExecStart = if cfg.relayOwnerNsecFile != null then | 243 | ExecStart = if cfg.relayOwnerNsecFile != null then |
| 244 | # Use nsec from file | 244 | # Use nsec from file - need to use shell to read the file |
| 245 | "${ngit-grasp}/bin/ngit-grasp --relay-owner-nsec $(cat ${cfg.relayOwnerNsecFile})" | 245 | "${pkgs.bash}/bin/bash -c '${ngit-grasp}/bin/ngit-grasp --relay-owner-nsec \"$(cat ${cfg.relayOwnerNsecFile})\"'" |
| 246 | else | 246 | else |
| 247 | # Let ngit-grasp auto-generate nsec in .relay-owner.nsec file in dataDir | 247 | # Let ngit-grasp auto-generate nsec in .relay-owner.nsec file in dataDir |
| 248 | "${ngit-grasp}/bin/ngit-grasp"; | 248 | "${ngit-grasp}/bin/ngit-grasp"; |