nixos/caddy: fix caddy fmt
for caddy v2.6.3
The nixos module uses `caddy fmt` to *format* the generated Caddyfile. v2.6.3 slightly altered `caddy fmt`'s behavior. Excerpt from https://github.com/caddyserver/caddy/releases/tag/v2.6.3 > cmd: caddy fmt return code is 1 if not formatted > cmd: fmt exit successfully after overwriting config file Which is why the internal `Caddyfile-formatted` now uses `cp` and `caddy fmt --overwrite` instead
This commit is contained in:
parent
f446d27253
commit
f5a06f7150
@ -35,7 +35,8 @@ let
|
||||
|
||||
Caddyfile-formatted = pkgs.runCommand "Caddyfile-formatted" { nativeBuildInputs = [ cfg.package ]; } ''
|
||||
mkdir -p $out
|
||||
${cfg.package}/bin/caddy fmt ${Caddyfile}/Caddyfile > $out/Caddyfile
|
||||
cp --no-preserve=mode ${Caddyfile}/Caddyfile $out/Caddyfile
|
||||
caddy fmt --overwrite $out/Caddyfile
|
||||
'';
|
||||
in
|
||||
"${if pkgs.stdenv.buildPlatform == pkgs.stdenv.hostPlatform then Caddyfile-formatted else Caddyfile}/Caddyfile";
|
||||
|
Loading…
Reference in New Issue
Block a user