mkCargoDerivation warns about not using a hardcoded stdenv but isntead
providing a selector function. In addition the log output from cargo
should be captured into a special file.
Signed-off-by: Tobias Kohlbau <tobias@kohlbau.de>
The runtime directory should be correctly set without the need to set
HELIX_RUNTIME manually because we check for a runtime directory within
CARGO_MANIFEST_DIR.
This change also filters the runtime directory out of the source file
set passed to buildRustPackage since the runtime directory is not needed
at compilation time.
The flake sets `RUSTFLAGS` and that overwrites the setting in
`.cargo/config.toml`. We need to add the `--cfg tokio_unstable` flag to
enable integration tests to run when called from the devShell.
These are necessary for creating dev environments which use the plugin
system. Making them a flake output makes it easy to get them without
having `cargo xtask code-gen` modify your ~/.config directory.
This resolves a build issue with nci/dream2nix and git dependencies.
We can keep most of the helix-specific parts of the flake, we just need
to switch from configuring nci to calling craneLib functions.
We also switch to flake-utils from flake-parts:
* Using rust-overlay with flake-parts directly is unergonomic
(see https://github.com/hercules-ci/flake-parts/discussions/83).
* Removing flake-parts reduces the overall dependencies: rust-overlay
already depends on flake-utils.
Runs of `cargo build` would fail with `ld: framework not found
CoreFoundation` inside a devshell (`nix develop`) on a Darwin host.
This is fixed with two changes:
* Including the `CoreFoundation` package within the devshell's
derivation.
* Switching from `value` to `eval` so that we append to the `RUSTFLAGS`
environment variable rather than overwriting it. `numtide/devshell`
already exposes the `Library/Frameworks` path within the devshell
derivation but it was being overwritten by the manual setting of
`RUSTFLAGS` in `env`.
Here we perform a shallow fetch using builtins.fetchTree. In order
to make this work, we need to specify the `ref' for any repository
that doesn't have `master' as its default branch (I'm not sure why
this limitation exists since we don't need this when performing
the shallow fetch in `--grammar build')
This `ref' field is ignored by helix, so I have left it undocumented
for now, but I could be open to documenting it.