feat: Pass through copyBins/copyLibs

This commit is contained in:
Nathan McCarty 2023-06-11 02:29:05 -04:00
parent 97d99b872d
commit 1e856f008b
Signed by: thatonelutenist
SSH Key Fingerprint: SHA256:hwQEcmak9E6sdU9bXc98RHw/Xd1AhpB5HZT7ZSVJkRM
1 changed files with 7 additions and 11 deletions

View File

@ -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;