treewide: run nginx -t on all nginx config files
Eval nix flake / evals (push) Failing after 1m47s Details
Eval nix flake / evals (pull_request) Failing after 1m49s Details

This commit is contained in:
Daniel Lovbrotte Olsen 2024-04-11 21:20:25 +02:00
parent 03c9638098
commit 32db921204
2 changed files with 14 additions and 1 deletions

View File

@ -61,7 +61,9 @@
pkgs = import nixpkgs {
inherit system;
overlays = [ ] ++ config.overlays or [ ];
overlays = [
(import ./overlays/nginx-test.nix)
] ++ config.overlays or [ ];
};
}
(removeAttrs config [ "modules" "overlays" ])

11
overlays/nginx-test.nix Normal file
View File

@ -0,0 +1,11 @@
final: prev: {
writers = prev.writers // {
writeNginxConfig = name: text: final.runCommandLocal name {
nginxConfig = prev.writers.writeNginxConfig name text;
nativeBuildInputs = [ final.nginx ];
} ''
ln -s "$nginxConfig" "$out"
nginx -t -c "$out"
'';
};
}