mirror of
https://gitlab.com/famedly/conduit.git
synced 2025-01-14 21:46:29 +03:00
make let bindings take pkgs as an argument
Again, will make cross compilation easier to set up.
This commit is contained in:
parent
cf4015b830
commit
692a31620d
1 changed files with 12 additions and 13 deletions
25
flake.nix
25
flake.nix
|
@ -57,20 +57,20 @@
|
||||||
fenix.packages.${system}.latest.rustfmt
|
fenix.packages.${system}.latest.rustfmt
|
||||||
]);
|
]);
|
||||||
|
|
||||||
builder =
|
builder = pkgs:
|
||||||
((crane.mkLib pkgsHost).overrideToolchain buildToolchain).buildPackage;
|
((crane.mkLib pkgs).overrideToolchain buildToolchain).buildPackage;
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = pkgs: [
|
||||||
pkgsHost.rustPlatform.bindgenHook
|
pkgs.rustPlatform.bindgenHook
|
||||||
];
|
];
|
||||||
|
|
||||||
env = {
|
env = pkgs: {
|
||||||
ROCKSDB_INCLUDE_DIR = "${pkgsHost.rocksdb}/include";
|
ROCKSDB_INCLUDE_DIR = "${pkgs.rocksdb}/include";
|
||||||
ROCKSDB_LIB_DIR = "${pkgsHost.rocksdb}/lib";
|
ROCKSDB_LIB_DIR = "${pkgs.rocksdb}/lib";
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
packages.default = builder {
|
packages.default = builder pkgsHost {
|
||||||
src = nix-filter {
|
src = nix-filter {
|
||||||
root = ./.;
|
root = ./.;
|
||||||
include = [
|
include = [
|
||||||
|
@ -83,9 +83,8 @@
|
||||||
# This is redundant with CI
|
# This is redundant with CI
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
|
|
||||||
inherit
|
env = env pkgsHost;
|
||||||
env
|
nativeBuildInputs = nativeBuildInputs pkgsHost;
|
||||||
nativeBuildInputs;
|
|
||||||
|
|
||||||
meta.mainProgram = cargoToml.package.name;
|
meta.mainProgram = cargoToml.package.name;
|
||||||
};
|
};
|
||||||
|
@ -111,7 +110,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
devShells.default = pkgsHost.mkShell {
|
devShells.default = pkgsHost.mkShell {
|
||||||
env = env // {
|
env = env pkgsHost // {
|
||||||
# Rust Analyzer needs to be able to find the path to default crate
|
# Rust Analyzer needs to be able to find the path to default crate
|
||||||
# sources, and it can read this environment variable to do so. The
|
# sources, and it can read this environment variable to do so. The
|
||||||
# `rust-src` component is required in order for this to work.
|
# `rust-src` component is required in order for this to work.
|
||||||
|
@ -119,7 +118,7 @@
|
||||||
};
|
};
|
||||||
|
|
||||||
# Development tools
|
# Development tools
|
||||||
nativeBuildInputs = nativeBuildInputs ++ [
|
nativeBuildInputs = nativeBuildInputs pkgsHost ++ [
|
||||||
devToolchain
|
devToolchain
|
||||||
] ++ (with pkgsHost; [
|
] ++ (with pkgsHost; [
|
||||||
engage
|
engage
|
||||||
|
|
Loading…
Reference in a new issue