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