Adapt to new trustfall model
Signed-off-by: Marcel Müller <neikos@neikos.email>
This commit is contained in:
parent
e600807376
commit
11c3a8de94
14 changed files with 1632 additions and 685 deletions
59
flake.nix
59
flake.nix
|
|
@ -16,8 +16,17 @@
|
|||
};
|
||||
};
|
||||
|
||||
outputs = { self, nixpkgs, crane, flake-utils, rust-overlay, ... }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
outputs =
|
||||
{
|
||||
self,
|
||||
nixpkgs,
|
||||
crane,
|
||||
flake-utils,
|
||||
rust-overlay,
|
||||
...
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (
|
||||
system:
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
|
|
@ -25,29 +34,51 @@
|
|||
};
|
||||
|
||||
rustTarget = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
|
||||
unstableRustTarget = pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default.override {
|
||||
extensions = [ "rust-src" "miri" "rustfmt" ];
|
||||
});
|
||||
unstableRustTarget = pkgs.rust-bin.selectLatestNightlyWith (
|
||||
toolchain:
|
||||
toolchain.default.override {
|
||||
extensions = [
|
||||
"rust-src"
|
||||
"miri"
|
||||
"rustfmt"
|
||||
];
|
||||
}
|
||||
);
|
||||
craneLib = (crane.mkLib pkgs).overrideToolchain rustTarget;
|
||||
unstableCraneLib = (crane.mkLib pkgs).overrideToolchain unstableRustTarget;
|
||||
|
||||
tomlInfo = craneLib.crateNameFromCargoToml { cargoToml = ./Cargo.toml; };
|
||||
inherit (tomlInfo) pname version;
|
||||
inherit (tomlInfo) version;
|
||||
|
||||
src = ./.;
|
||||
|
||||
rustfmt' = pkgs.writeShellScriptBin "rustfmt" ''
|
||||
exec "${unstableRustTarget}/bin/rustfmt" "$@"
|
||||
'';
|
||||
|
||||
cargoArtifacts = craneLib.buildDepsOnly {
|
||||
inherit src;
|
||||
cargoExtraArgs = "--all-features --all";
|
||||
common = {
|
||||
src = ./.;
|
||||
|
||||
buildInputs = [
|
||||
pkgs.openssl
|
||||
pkgs.pkg-config
|
||||
];
|
||||
};
|
||||
|
||||
plaixt = craneLib.buildPackage {
|
||||
inherit cargoArtifacts src version;
|
||||
cargoExtraArgs = "--all-features --all";
|
||||
};
|
||||
cargoArtifacts = craneLib.buildDepsOnly (
|
||||
common
|
||||
// {
|
||||
cargoExtraArgs = "--all-features --all";
|
||||
}
|
||||
);
|
||||
|
||||
plaixt = craneLib.buildPackage (
|
||||
common
|
||||
// {
|
||||
inherit cargoArtifacts version;
|
||||
cargoExtraArgs = "--all-features --all";
|
||||
}
|
||||
);
|
||||
|
||||
in
|
||||
rec {
|
||||
|
|
@ -78,6 +109,8 @@
|
|||
devShells.plaixt = pkgs.mkShell {
|
||||
buildInputs = [ ];
|
||||
|
||||
inputsFrom = [ plaixt ];
|
||||
|
||||
nativeBuildInputs = [
|
||||
rustfmt'
|
||||
rustTarget
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue