terraform-provider-nix
terraform-provider-nix copied to clipboard
Build dependencies
Found BuildHost, but I'm not sure how complete that is. My use case is deploying to AWS (working on a minimal example) with a team on both OSX and Linux. So probably want to do all building on the target, so I use a known ami to start the process, rather than a local build of the image. I'm not sure how much can be delegated to the build host.
I have never tried cross deploying as I developed this with Linux exclusively.
I don't have any OSX machines so can't help you too much. This plugin uses nixos-rebuild directly, which may not be supported from OSX.
While i cannot confirm yet if this works on OSX (I am Linux but my colleagues are OSX but we are all isolated WFH for the pandemic) however as I understand nix's cross compiling capabilities you should be able to build locally on osx and still deploy to a linux machine. The obvious issue is how to get nixos-rebuild
on a mac. I have been using this in a shell.nix
to create a package like nixpkgs does and add it to the buildInputs in my shell.
with <nixpkgs>;
let
nixos-rebuild = let
fallback = import <nixpkgs/nixos/modules/installer/tools/nix-fallback-paths.nix>;
in substituteAll {
name = "nixos-rebuild";
dir = "bin";
isExecutable = true;
src = <nixpkgs/nixos/modules/installer/tools/nixos-rebuild.sh>;
nix = nix.out;
nix_x86_64_linux = fallback.x86_64-linux;
nix_i686_linux = fallback.i686-linux;
path = makeBinPath [ jq ];
};
in mkDerivation {
buildInputs = [nixos-rebuild];
}