Commit Graph

651 Commits

Author SHA1 Message Date
Ivan Petkov
5dca7b9493
chore: bump cargo locked versions 2022-01-30 16:09:21 -08:00
Ivan Petkov
492076c765 Rename registryFromGitIndex input to indexUrl for consistency 2022-01-30 23:58:56 +00:00
Ivan Petkov
4adc828133 Add example for using an alternative cargo registry 2022-01-30 23:58:56 +00:00
Ivan Petkov
715c8731c3 Add regression test for manually vendored dependencies 2022-01-30 23:58:56 +00:00
Ivan Petkov
47fbae6dc3 Add support for alternative cargo registries 2022-01-30 23:58:56 +00:00
Ivan Petkov
5e44613211 Make crate downloads aware of alternative registries 2022-01-30 23:58:56 +00:00
Ivan Petkov
5bae4b91c1 Optimize searching for cargo configuration files
* Rather than recursively look up all paths in a given project and then
  filtering for cargo-specific files, we now use our own customized
  traversal method to only capture the results we want.
2022-01-30 23:58:56 +00:00
Ivan Petkov
4a2dd7388c
Reword some potentially misleading claims 2022-01-23 14:52:16 -08:00
Ivan Petkov
55b3f63d78
Minor README tweak 2022-01-22 13:36:41 -08:00
Ivan Petkov
d50701ba5a
flake.lock: Update
Flake lock file changes:

• Updated input 'flake-compat':
    'github:edolstra/flake-compat/12c64ca55c1014cdc1b16ed5a804aa8576601ff2' (2021-08-02)
  → 'github:edolstra/flake-compat/b7547d3eed6f32d06102ead8991ec52ab0a4f1a7' (2022-01-03)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/0c408a087b4751c887e463e3848512c12017be25' (2021-12-23)
  → 'github:NixOS/nixpkgs/787ced6423cbfd130471aaf0a5e66ca3fd3e6af0' (2022-01-21)
• Updated input 'utils':
    'github:numtide/flake-utils/74f7e4319258e287b0f9cb95426c9853b282730b' (2021-11-28)
  → 'github:numtide/flake-utils/846b2ae0fc4cc943637d3d1def4454213e203cba' (2022-01-20)
2022-01-22 11:47:44 -08:00
Ivan Petkov
6e168778db
Minor README rewording 2022-01-22 11:47:18 -08:00
Ivan Petkov
09049b0ce3
Fix template tests 2022-01-22 10:21:08 -08:00
Ivan Petkov
cc7c158ca1
Add a README in the examples directory 2022-01-22 10:17:05 -08:00
Ivan Petkov
8c63723ea0
Update README with a more in-depth philosophy discussion 2022-01-18 20:51:11 -08:00
Ivan Petkov
9ce8929770
Add LICENSE 2022-01-17 15:05:45 -08:00
Ivan Petkov
89eb07f68e
Fix typo 2022-01-17 15:01:58 -08:00
Ivan Petkov
282a3b502a
Add README 2022-01-17 15:01:21 -08:00
Ivan Petkov
67c680b5dc
Move API docs to their own file 2022-01-17 13:56:03 -08:00
Ivan Petkov
405c9cb8cf
Update quick-start template with cargoFmt and cargoTarpaulin 2022-01-17 13:06:11 -08:00
Ivan Petkov
8f6b608ca1
Inline Cargo.{toml,lock} checks in buildDepsOnly 2022-01-16 18:24:13 -08:00
Ivan Petkov
aeb598b174
Add cargoTarpaulin 2022-01-16 18:16:21 -08:00
Ivan Petkov
438154f265
Add cargoFmt 2022-01-16 17:49:39 -08:00
Ivan Petkov
e457182093
Add quick-start template with a clippy check
* Also rename `hello-world` to `quick-start-simple`
2022-01-16 16:56:30 -08:00
Ivan Petkov
725a646c8d
Add CI 2022-01-16 16:15:12 -08:00
Ivan Petkov
e2cc10bb60
Inline template definition in flake.nix 2022-01-16 16:11:11 -08:00
Ivan Petkov
9ef96fbfeb
Add a custom rust toolchain example/template 2022-01-16 15:38:59 -08:00
Ivan Petkov
1ab55bba74
Add hello-world example/template 2022-01-16 14:33:47 -08:00
Ivan Petkov
7f392394e7
Add mkLib function 2022-01-15 20:29:39 -08:00
Ivan Petkov
13c6a4cdce
crateNameFromCargoToml: use 0.0.1 as fallback version 2022-01-15 19:58:31 -08:00
Ivan Petkov
92d185d877
Fix some formatting 2022-01-15 19:56:46 -08:00
Ivan Petkov
8362763342
Add hooks documentation 2022-01-15 17:59:34 -08:00
Ivan Petkov
3967b68793
Add API documentation 2022-01-12 20:11:14 -08:00
Ivan Petkov
72bb21ee86
crateNameFromCargoToml: fix parameter validation
* Previously the check was overzealous and it was impossible to only
  specify `cargoToml` (since both other parameters would be null)
* Instead, we take advantage of Nix's laziness and only throw when
  needed
2022-01-09 15:50:21 -08:00
Ivan Petkov
3f82111135
Merge vendorCargoDepsFromArgs into vendorCargoDeps 2022-01-08 17:52:10 -08:00
Ivan Petkov
bd27ed8f73
cargoClippy: remove unused parameter 2022-01-08 17:24:57 -08:00
Ivan Petkov
49ef407216
Rename doCopyTargetToOutput to doInstallCargoArtifacts
* Similarly rename `installCargoTargetDirHook` to
  `installCargoArtifactsHook`
* The intention is to highlight that "install" implies "copy to output"
  and not anywhere else
* Also avoids the potential confusion of "cargo target dir" (location of
  cargo's artifacts) with "cargo target" (which is the target
  architecture/platform we want cargo to build for)
2022-01-08 17:14:05 -08:00
Ivan Petkov
4099e352b8
cargoClippy: do not force cargo target dir to be installed
* Just having the derivation succeed is evidence enough and copying the
  artifacts isn't strictly necessary
2022-01-08 17:03:06 -08:00
Ivan Petkov
263fe7c78f
Fix operator precedence typo
* In Nix the `or` operator has higher precedence than function
  application, therefore `x or y z` parses as `(x or y) z`
2022-01-08 16:57:45 -08:00
Ivan Petkov
1c9633f4aa
mkDummySrc: allow cargoLock location to be passed in by caller
* This can potentially allow callers to build crates which may not have
  a Cargo.lock in their source but needs to be passed in from
  _elsewhere_
2022-01-07 20:54:07 -08:00
Ivan Petkov
44e9060497
Print cargo version before building
* Just for the benefit of being able to tell at which cargo version is
  used at a glance
2022-01-07 20:48:52 -08:00
Ivan Petkov
abc2c8c418
mkDummySrc: drop dummy lib.rs by default, not main.rs
* There are some edge cases where cargo will allow a lib.rs file to be
  present but not a main.rs (e.g. a binary cannot be called "examples",
  which will happen if the crate is called that and a main.rs file is
  present)
2022-01-07 20:42:24 -08:00
Ivan Petkov
bcec95e215
Add test for rooted workspace 2022-01-07 18:03:12 -08:00
Ivan Petkov
a8c6f256bc
Add tests for a simple workspace 2022-01-07 17:56:12 -08:00
Ivan Petkov
1c8034c0d9
Update mkDummySrc to support cargo workspaces 2022-01-07 17:36:31 -08:00
Ivan Petkov
791f1b2241
Add tests for mkDummySrc
* Also fix a bug with copying over .cargo/config files
2022-01-05 20:46:05 -08:00
Ivan Petkov
daae0bac2b
Rename checks/cleanCargoToml directory for consistency 2022-01-05 20:14:45 -08:00
Ivan Petkov
aa58fce185
Memoize some parameters to avoid recomputing the vendorDir when possible 2022-01-04 18:25:39 -08:00
Ivan Petkov
7ec94f9653
Remove internally used parameters from derivations where possible
* By default we pass everything through to the actual derivation itself,
  but some internal parameters don't show up as environment variables
  directly (or rather do not need to)
* In an effort to keep the build environment as lean as possible, we can
  do some clean up (e.g. to avoid invalidating builds if some parameter
  changes but is completely ignored/overridden elsewhere)
2022-01-04 17:45:31 -08:00
Ivan Petkov
98d59e6a6c
Replace regex dependencies with byteorder
* This should make the tests a bit more lightweight as we only have to
  build one crate instead of several
2022-01-04 14:48:40 -08:00
Ivan Petkov
3da8e2e195
Enable doCheck on derivations by default 2022-01-04 14:40:24 -08:00