Commit 973c156ffc7c

Vincent Demeester <vincent@sbr.pm>
2026-01-14 10:12:53
fix(harmonia): remove duplicate backslash in curl notification commands
The Authorization header had a trailing backslash inside the Nix string literal, which combined with the Nix-level line continuation backslash to create invalid shell syntax: `\ \` (backslash-space-backslash). This caused curl to emit "URL rejected: Malformed input to a URL function" errors, though the notifications still eventually succeeded. Removed the trailing backslash from the optionalString output since the line continuation is already handled at the Nix level. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 91f2af0
Changed files (1)
modules
harmonia
modules/harmonia/default.nix
@@ -180,7 +180,7 @@ in
               ${pkgs.curl}/bin/curl -X POST \
                 ${
                   optionalString (cfg.builder.notification.tokenFile != null)
-                    ''-H "Authorization: Bearer $(${pkgs.coreutils}/bin/tr -d '\n' < ${cfg.builder.notification.tokenFile})" \''
+                    ''-H "Authorization: Bearer $(${pkgs.coreutils}/bin/tr -d '\n' < ${cfg.builder.notification.tokenFile})"''
                 } \
                 -H "Title: Cache Builder Starting (${config.networking.hostName})" \
                 -d "Building ${toString (length cfg.builder.systems)} system(s) for cache pre-population" \
@@ -191,7 +191,7 @@ in
               ${pkgs.curl}/bin/curl -X POST \
                 ${
                   optionalString (cfg.builder.notification.tokenFile != null)
-                    ''-H "Authorization: Bearer $(${pkgs.coreutils}/bin/tr -d '\n' < ${cfg.builder.notification.tokenFile})" \''
+                    ''-H "Authorization: Bearer $(${pkgs.coreutils}/bin/tr -d '\n' < ${cfg.builder.notification.tokenFile})"''
                 } \
                 -H "Title: Cache Builder Complete (${config.networking.hostName})" \
                 -H "Tags: white_check_mark" \
@@ -203,7 +203,7 @@ in
               ${pkgs.curl}/bin/curl -X POST \
                 ${
                   optionalString (cfg.builder.notification.tokenFile != null)
-                    ''-H "Authorization: Bearer $(${pkgs.coreutils}/bin/tr -d '\n' < ${cfg.builder.notification.tokenFile})" \''
+                    ''-H "Authorization: Bearer $(${pkgs.coreutils}/bin/tr -d '\n' < ${cfg.builder.notification.tokenFile})"''
                 } \
                 -H "Title: Cache Builder Failed (${config.networking.hostName})" \
                 -H "Tags: x,warning" \