<!-- The PR description should answer 2 important questions: -->
### What
Our Nix build was building all the workspace crates as part of it's deps
step. This means when any library crate is changed, we throw away all
the caching, which isn't ideal. This filters the source files out of
those builds, so that we get more cache hits. We also move all Cargo
features into the workspace, which I've been meaning to do for ages, so
things are more consistent, and again, we get more cache hits generally.
V3_GIT_ORIGIN_REV_ID: c724b152692575edf6c00ab426e48ecca13aa998
<!-- The PR description should answer 2 important questions: -->
### What
All the docs examples have it, [it's recommended by the
author](https://github.com/ipetkov/crane/issues/403#issuecomment-1743416192),
and it should help with unnecessary rebuilds.
V3_GIT_ORIGIN_REV_ID: 3596dd987090756e0914f7babb1329c0d9c1a263
<!-- The PR description should answer 2 important questions: -->
### What
I feel like Nix builds more than it should, and I'm interested why.
[According to the crane
docs](https://crane.dev/faq/constant-rebuilds.html#debugging-with-just-nix),
we can use this to hopefully see what is going on, by diffing the output
between builds.
### How
Add `nix derivation show -r .#output` as a build step.
V3_GIT_ORIGIN_REV_ID: 32bce8315874b9effb075aa834a891cf0dcc00e2
Reverts hasura/v3-engine#1265
Tried this for a bit and it seems to have made our cache usage worse, so
let's not.
V3_GIT_ORIGIN_REV_ID: cb1e33d568da49a9af80591ec1db111fb62bf6ca
<!-- The PR description should answer 2 important questions: -->
### What
This was building more often than I'd expected - looking at the crane
docs we'll get more cache sharing if we build all the deps.
https://crane.dev/examples/quick-start.html?highlight=cargoArtifacts#
V3_GIT_ORIGIN_REV_ID: b6e29d8daa8b77b76324819607f0c50c1a00df70
<!-- The PR description should answer 2 important questions: -->
### What
Add `coreutils` to Docker images.
### How
<!-- How is it trying to accomplish it (what are the implementation
steps)? -->
V3_GIT_ORIGIN_REV_ID: a614c47758b726729208428890586d5aabac0797
<!-- The PR description should answer 2 important questions: -->
### What
<!-- What is this PR trying to accomplish (and why, if it's not
obvious)? -->
<!-- Consider: do we need to add a changelog entry? -->
<!-- Does this PR introduce new validation that might break old builds?
-->
<!-- Consider: do we need to put new checks behind a flag? -->
### How
<!-- How is it trying to accomplish it (what are the implementation
steps)? -->
V3_GIT_ORIGIN_REV_ID: c09d42519cdd4946527e72a8066d7aa60a75a4cf
### What
Use powerful constructs such as loops to avoid duplication in
`flake.nix`.
We are able to iterate over the list of binaries and list of target
systems and produce a list of packages from there.
### How
We generate a `targets` tree (see the `flake.nix` file comments for
details), and then generate the list of packages from there.
When using `nix run`, you'll get a package, which is usually what you
want.
The scripts that build Docker images run `nix build
'.#targets.x86_64-linux.<binary>.<arch>.docker`, which is verbose but
explicit.
V3_GIT_ORIGIN_REV_ID: 2a13fb31a41829f9804dfdb7c1a51a9e54e0922e
<!-- The PR description should answer 2 (maybe 3) important questions:
-->
### What
Allow engine to connect to NDCs via HTTPS.
<!-- What is this PR trying to accomplish (and why, if it's not
obvious)? -->
<!-- Consider: do we need to add a changelog entry? -->
### How
Add `cacert` to Docker image using Nix.
<!-- How is it trying to accomplish it (what are the implementation
steps)? -->
V3_GIT_ORIGIN_REV_ID: 52458920236f3868cc8daf18e140f8536d9bc674
This means we can use the cache far more often.
Pull requests will also use "dev" so as to avoid rebuilding
unnecessarily. Only builds on the `main` branch and tags will set a
version (using the short Git commit hash).
V3_GIT_ORIGIN_REV_ID: 37acaec3d369eef6df6487f9612f6d2da3e3ba5a
<!-- Thank you for submitting this PR! :) -->
## Description
We'd like to speed up creation of all these Docker images, so this adds
`dev-auth-webhook` to the Nix flake. Functional no-op.
---------
Co-authored-by: Samir Talwar <samir.talwar@hasura.io>
V3_GIT_ORIGIN_REV_ID: 384eb467b2fe7fba1644f5b4cc6224cdc043ce01
<!-- Thank you for submitting this PR! :) -->
## Description
In order to test things quicker, we'd like to be able to build custom
connector and friends in Nix, and then use the containers when running
tests. First step here is to be able to build Docker containers in Nix,
and add a CI job to ensure it still works.
Then we'll move onto publishing and using these images.
No-op build times:
<img width="336" alt="Screenshot 2024-04-25 at 15 53 56"
src="https://github.com/hasura/v3-engine/assets/4729125/47cbc0c5-6e54-4583-aa01-0528d4a21080">
Functional no-op.
V3_GIT_ORIGIN_REV_ID: 8f9d609e26cdd3b0801e61fd361c241ad504dcdf