Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Darwin platform #1

Open
kolpav opened this issue Jun 12, 2022 · 3 comments
Open

Darwin platform #1

kolpav opened this issue Jun 12, 2022 · 3 comments

Comments

@kolpav
Copy link

kolpav commented Jun 12, 2022

Could you please provide target for darwin platform there should be very little incompatibility when building I think.

I have tried to do it myself and make a PR but failed maybe when I am done with reading all the pills,nixpkgs resources I will be able to contribute somehow I would really like this project succeed it looks great and exactly what I would like to use 👍

$ terraform init -upgrade

Initializing the backend...

Initializing provider plugins...
- Finding corpix/nixos versions matching "0.0.8"...
╷
│ Error: Incompatible provider version
│
│ Provider registry.terraform.io/corpix/nixos v0.0.8 does not have a package available for your current platform, darwin_amd64.
│
│ Provider releases are separate from Terraform CLI releases, so not all providers are available for all platforms. Other versions of this provider may have different platforms
│ supported.
@kolpav kolpav changed the title Darwin target Darwin platform Jun 12, 2022
@corpix
Copy link
Owner

corpix commented Jun 13, 2022

Hi @kolpav . I have added cross-compilation for darwin (amd64 & arm64) and linux (arm64) in version 0.0.9.
Now provider should be available for Terraform on your platform.

But I think this is far from enough because there are probably a lot things to be done before anything could be deployed from OSX to NixOS host because of cross-compilation. I am sure there will be a lot of problems. Maybe I could address some of them on the Terraform provider level configuration wrapper. But I don't use OSX in my everyday life and can not test this changes. So, hopefully this could be done by somebody in future, I'll do my best to help

@corpix
Copy link
Owner

corpix commented Jun 13, 2022

Forgot to mention: there is another way to deploy configuration to NixOS hosts from OSX, some of my teammates using this, you could run a Docker container with Nix like this:

docker run -it -v nix:/nix:rw -v $HOME/.ssh:/chroot/.ssh:rw -v $(pwd):/src -e HOME=/chroot -w /src --platform=linux/amd64 nixos/nix:2.9.0 

It will run container with Nix. Inside this container you could run nix-shell -p terraform which will provide a Terraform tool.
This relies on the fact that Docker uses virtual machine on OSX.

@kolpav
Copy link
Author

kolpav commented Jun 14, 2022

@corpix That was quick, thank you. installation passed I'll give it a go, hopefully I'll be able to get rid of ansible soon. Since you mentioned using docker as an workaround for potential compatibility issues, there is also https://github.com/lima-vm/lima (docker/-compose) and https://multipass.run for quick cli vms might be useful for your teammates or future readers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants