Uses several hacks to get Nix working in AWS Lambda.
- containers
- chroot
- fakeroot
- udocker
- LD_PRELOAD
- namespaces
- nix rewriting
- nix patching
- early kill of builder
- nix configuration
- nix bundling
- ptmx,pty horror
TL;DR
make bundle
make update
make invoke
What is happening?
- Produce the Package. This involves a patched Nix (NixOS/nix#2176) and including several additional libraries like certs, fakechroot. Then rewrite all the paths (https://github.com/timjrd/nixrewrite).
- Upload to AWS. Must have a
.arn
containing the arn for a role with permissions for your lambda funcion. - Create a serialized description of the inputs and steps to take, out.nar.
- Invoke the Lambda with the NAR, and obtain a build.
- Add additional commands to move the build to a cache (like
nix copy
, it works with s3). - ???
- Profit