feat: Pass through copyBins/copyLibs
This commit is contained in:
parent
97d99b872d
commit
1e856f008b
18
flake.nix
18
flake.nix
|
@ -60,7 +60,7 @@
|
|||
{
|
||||
# Build a rust flake with a single crate
|
||||
single = { src, crateName, sharedDeps ? (system: [ ])
|
||||
, sharedNativeDeps ? (system: [ ]) }:
|
||||
, sharedNativeDeps ? (system: [ ]), copyBins ? true, copyLibs ? false }:
|
||||
utils.lib.eachDefaultSystem (system:
|
||||
let
|
||||
pkgs = import nixpkgs {
|
||||
|
@ -103,23 +103,20 @@
|
|||
# Main binary
|
||||
packages.${crateName} = naersk-lib.buildPackage {
|
||||
pname = "${crateName}";
|
||||
inherit buildInputs;
|
||||
inherit nativeBuildInputs;
|
||||
inherit buildInputs nativeBuildInputs copyBins copyLibs;
|
||||
root = src;
|
||||
};
|
||||
# binary + tests
|
||||
packages.tests.${crateName} = naersk-lib.buildPackage {
|
||||
pname = "${crateName}";
|
||||
inherit buildInputs;
|
||||
inherit nativeBuildInputs;
|
||||
inherit buildInputs nativeBuildInputs copyBins copyLibs;
|
||||
root = src;
|
||||
doCheck = true;
|
||||
};
|
||||
# Docs
|
||||
packages.docs.${crateName} = naersk-lib.buildPackage {
|
||||
pname = "${crateName}";
|
||||
inherit buildInputs;
|
||||
inherit nativeBuildInputs;
|
||||
inherit buildInputs nativeBuildInputs copyBins copyLibs;
|
||||
root = src;
|
||||
dontBuild = true;
|
||||
doDoc = true;
|
||||
|
@ -136,7 +133,7 @@
|
|||
stdenv.mkDerivation {
|
||||
name = "format lint";
|
||||
src = src;
|
||||
inherit buildInputs;
|
||||
inherit buildInputs copyBins copyLibs;
|
||||
nativeBuildInputs = with pkgs;
|
||||
[ rust-bin.stable.latest.default ] ++ nativeBuildInputs;
|
||||
dontConfigure = true;
|
||||
|
@ -148,7 +145,7 @@
|
|||
stdenv.mkDerivation {
|
||||
name = "audit lint";
|
||||
src = src;
|
||||
inherit buildInputs;
|
||||
inherit buildInputs copyBins copyLibs;
|
||||
nativeBuildInputs = with pkgs;
|
||||
[ rust-bin.stable.latest.default ] ++ nativeBuildInputs;
|
||||
dontConfigure = true;
|
||||
|
@ -164,8 +161,7 @@
|
|||
clippy.${crateName} = naersk-lib.buildPackage {
|
||||
pname = "${crateName}";
|
||||
root = src;
|
||||
inherit buildInputs;
|
||||
inherit nativeBuildInputs;
|
||||
inherit buildInputs nativeBuildInputs copyBins copyLibs;
|
||||
cargoTestCommands = (old: [ "cargo $cargo_options clippy" ]);
|
||||
doCheck = true;
|
||||
dontBuild = true;
|
||||
|
|
Loading…
Reference in New Issue