treewide: run nginx -t on all nginx config files #32

Merged
danio merged 3 commits from test-nginx-overlay into main 2024-04-11 23:39:42 +02:00
2 changed files with 14 additions and 1 deletions
Showing only changes of commit 9b4fbd847f - Show all commits

View File

@ -64,7 +64,9 @@
pkgs = import nixpkgs { pkgs = import nixpkgs {
inherit system; inherit system;
overlays = [ ] ++ config.overlays or [ ]; overlays = [
(import ./overlays/nginx-test.nix)
] ++ config.overlays or [ ];
}; };
} }
(removeAttrs config [ "modules" "overlays" ]) (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"
'';
};
}