Terraform Version
Terraform v1.3.6
on linux_amd64
(using outdated nixpkgs stable branch)
Use Cases
- Easier packaging
Nix expose completions from a special folder in referenced Nix components. This feature will allow basically a no brainer easy integration with how Nix works to generate completions. Instead of the user having to do an imperative step, the completions is available only by nix-shell terraform without a global installation.
Attempted Solutions
-
terraform -install-autocomplete
Imperative approach. Fails if you use home-manager because ~/.bashrc is a symlink to a file in the nix store, that is read only.
-
HOME=/somewhere/else terraform -install-autocomplete
Terraform ignores the environment variable and tries to write ~/.bashrc anyway.
Proposal
The same approach rclone uses to expose completions, ex:
rclone completion bash generate bash completion and output to stdout
- It also works with fish, powershell and zsh, but support these shells is another problem.
References
Terraform Version
Use Cases
Nix expose completions from a special folder in referenced Nix components. This feature will allow basically a no brainer easy integration with how Nix works to generate completions. Instead of the user having to do an imperative step, the completions is available only by nix-shell terraform without a global installation.
Attempted Solutions
terraform -install-autocompleteImperative approach. Fails if you use home-manager because ~/.bashrc is a symlink to a file in the nix store, that is read only.
HOME=/somewhere/else terraform -install-autocompleteTerraform ignores the environment variable and tries to write ~/.bashrc anyway.
Proposal
The same approach rclone uses to expose completions, ex:
rclone completion bashgenerate bash completion and output to stdoutReferences