diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-11 21:21:14 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-01-11 21:21:14 +0000 |
| commit | a63dc8a9e5f9cad50f4ea7c6c5d2ed544bc70656 (patch) | |
| tree | b54e66a7e73a968bfd2858123e3675d94646d1b2 /nix | |
| parent | 809982cdc78e287bc9f3fc0dbac5e2aab2fd7f7d (diff) | |
fix(nix): add coreutils to PATH and use absolute path for cat in nsec file reading
- Add coreutils to systemd service PATH so cat command is available
- Use absolute path for cat in ExecStart for reliability
- Fixes startup panic: relay_owner_keys should be available: Invalid relay_owner_nsec
- Fixes: cat: command not found error in systemd logs
This ensures the nsec file can be read properly during service startup,
allowing the sync manager to initialize correctly with relay owner authentication.
Diffstat (limited to 'nix')
| -rw-r--r-- | nix/module.nix | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/nix/module.nix b/nix/module.nix index d820b67..79b0e83 100644 --- a/nix/module.nix +++ b/nix/module.nix | |||
| @@ -239,13 +239,14 @@ let | |||
| 239 | # Working directory where .relay-owner.nsec will be created if needed | 239 | # Working directory where .relay-owner.nsec will be created if needed |
| 240 | WorkingDirectory = cfg.dataDir; | 240 | WorkingDirectory = cfg.dataDir; |
| 241 | 241 | ||
| 242 | # Add git to PATH for purgatory sync operations | 242 | # Add git, openssh, and coreutils to PATH for purgatory sync operations |
| 243 | Environment = "PATH=${pkgs.git}/bin:${pkgs.openssh}/bin"; | 243 | Environment = |
| 244 | "PATH=${pkgs.git}/bin:${pkgs.openssh}/bin:${pkgs.coreutils}/bin"; | ||
| 244 | 245 | ||
| 245 | # Command to run | 246 | # Command to run |
| 246 | ExecStart = if cfg.relayOwnerNsecFile != null then | 247 | ExecStart = if cfg.relayOwnerNsecFile != null then |
| 247 | # Use nsec from file - need to use shell to read the file | 248 | # 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})\"'" | 249 | "${pkgs.bash}/bin/bash -c '${ngit-grasp}/bin/ngit-grasp --relay-owner-nsec \"$(${pkgs.coreutils}/bin/cat ${cfg.relayOwnerNsecFile})\"'" |
| 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"; |