Hi everyone! I’m new to Nix OS so this might be a dumb question but I can’t find anyone talking about this either…
Brief:
I built a nixos amazonImage using nix-build, uploaded to aws S3 storage and tried to launch it. EC2 told me “ClientError: Unable to find an etc directory with fstab”
Details:
I built an image using this command inside nixpkgs directory:
nix-build -A amazonImage.x86_64-linux nixos/release.nix
The resultant files were stored in the result directory:
nixos-amazon-image-20.03pre130979.gfedcba-x86_64-linux.vhd
I uploaded the file to S3 storage and I’ve setup the service role vmimport so I can launch it using aws import-image command.
After launching it, an error occured saying “ClientError: Unable to find an etc directory with fstab”
Relevant Files
The release.nix I used is identical to this:
https://github.com/NixOS/nixpkgs/blob/f03558890739d833b5705e8ca3044d32fcc58d18/nixos/release.nix
The amazon-image.nix I used is identical to this:
https://github.com/NixOS/nixpkgs/blob/f03558890739d833b5705e8ca3044d32fcc58d18/nixos/maintainers/scripts/ec2/amazon-image.nix
Relevant Discussion but no solution
Some other devs(?) also had this issue back in may 2019 and they didnt seem to solve it either.
https://logs.nix.samueldr.com/nixos-dev/2019-05-10
** Other Questions **
Do you nix-build amazonImage.x86_64-linux or ova.x86_64-linux or anyother image format for aws ec2?
Thanks guys.