A Nix library for building cargo projects. Never build twice thanks to incremental artifact caching.
Go to file
Ivan Petkov 4c1711399d
Split out buildWithCargo into a lower level mkCargoDerivation
* The intention here is to split up different "responsibilities" into
  smaller parts which can be composed as a DAG rather than mutually
  recursive functions. Specifically:
* `mkCargoDerivation` represents a lower-level thin wrapper around
  `stdenv.mkDerivation` which will
  - set up hooks
  - require the caller to define the variables needed by the hooks (like
    vendor dir, or artifacts to inherit)
  - ensure that build/check/install phases can be configured by the
    caller without having them remember to call pre/post hooks
* This allows `buildDepsOnly` to only focus on setting some default
  values (like good default commands to build all artifacts, setting the
  derivation name, etc.) and delegating the rest to `mkCargoDerivation`
* Lastly, the responsibility of `buildWithCargo` ends up ensuring that
  `cargoArtifacts` and `cargoVendorDir` are defined if the caller does
  not pass them in
2022-01-02 14:48:32 -08:00
checks Move all tests (except for formatting) out of flake checks 2021-12-30 17:18:17 -08:00
lib Split out buildWithCargo into a lower level mkCargoDerivation 2022-01-02 14:48:32 -08:00
pkgs Do not copy cargo artifacts into a separate output by default 2022-01-01 11:12:13 -08:00
tests Do not copy cargo artifacts into a separate output by default 2022-01-01 11:12:13 -08:00
.envrc Move all tests (except for formatting) out of flake checks 2021-12-30 17:18:17 -08:00
.gitignore Add checks for cleanCargoToml 2021-12-29 19:26:55 -08:00
default.nix Move all tests (except for formatting) out of flake checks 2021-12-30 17:18:17 -08:00
flake.lock Move all tests (except for formatting) out of flake checks 2021-12-30 17:18:17 -08:00
flake.nix Move all tests (except for formatting) out of flake checks 2021-12-30 17:18:17 -08:00
runTests.sh Move all tests (except for formatting) out of flake checks 2021-12-30 17:18:17 -08:00