terraform-nixos
terraform-nixos copied to clipboard
deploy_nixos: hash changes when files change in the working directory, even .gitignored files with flakes
Describe the bug
deploy_nixos evaluates an expression which has ./. as source. The hash of this derivation changes when local files change, even .gitignored files, even when using a flake. This causes unnecessary reevaluation.
https://github.com/tweag/terraform-nixos/blob/646cacb12439ca477c05315a7bfd49e9832bc4e3/deploy_nixos/nixos-instantiate.sh#L22
To Reproduce
terraform apply a deploy_nixos flake config. Change a .gitignored file. apply again. The evaluation is slow and the hash changes, requiring a new deploy.
Expected behavior The evaluation should be fast and no changes should be detected.
Environment
- OS name + version: NixOS unstable
- Version of the code: 646cacb12439ca477c05315a7bfd49e9832bc4e3