Files
vms/nix/validate.nix
T

24 lines
445 B
Nix
Raw Normal View History

2024-07-13 01:39:48 -05:00
{
writeShellApplication,
2024-07-13 03:03:14 -05:00
findutils,
2024-07-13 01:39:48 -05:00
packer,
...
}:
writeShellApplication {
name = "validate";
runtimeInputs = [
2024-07-13 03:03:14 -05:00
findutils
2024-07-13 01:39:48 -05:00
packer
];
text = ''
shopt -s globstar
2024-07-22 10:21:32 -05:00
if [ -e "''${PACKER_CONFIG_DIR}" ]; then
find "''${PACKER_CONFIG_DIR}" -name '*_linux_amd64' -exec chmod +x '{}' ";"
fi
2024-07-13 01:39:48 -05:00
packer init sources
for vars in distros/**/*.pkrvars.hcl; do
packer validate -except=upload "-var-file=''${vars}" sources/
done
'';
}