mirror of
https://codeberg.org/icewind/mill-scale.git
synced 2026-06-04 02:14:08 +02:00
This commit is contained in:
parent
c38c7c897b
commit
9adbac228a
1 changed files with 8 additions and 4 deletions
|
|
@ -7,7 +7,7 @@ let
|
||||||
inherit (builtins) elem readFile pathExists isAttrs attrNames match any;
|
inherit (builtins) elem readFile pathExists isAttrs attrNames match any;
|
||||||
inherit (lib) map mkDefault mkIf mkMerge mkOption warnIf assertMsg optionalAttrs types optionalString genAttrs hasInfix intersectLists foldl attrVals;
|
inherit (lib) map mkDefault mkIf mkMerge mkOption warnIf assertMsg optionalAttrs types optionalString genAttrs hasInfix intersectLists foldl attrVals;
|
||||||
inherit (lib.fileset) fileFilter toSource;
|
inherit (lib.fileset) fileFilter toSource;
|
||||||
inherit (flakelight.types) fileset function;
|
inherit (flakelight.types) fileset function optFunctionTo;
|
||||||
|
|
||||||
filteredSrc = toSource { root = src; inherit (config) fileset; };
|
filteredSrc = toSource { root = src; inherit (config) fileset; };
|
||||||
cargoToml = fromTOML (readFile (src + /Cargo.toml));
|
cargoToml = fromTOML (readFile (src + /Cargo.toml));
|
||||||
|
|
@ -94,6 +94,10 @@ warnIf (! builtins ? readFileType) "Unsupported Nix version in use."
|
||||||
default = true;
|
default = true;
|
||||||
description = "Automatically detect (some) of the build dependencies";
|
description = "Automatically detect (some) of the build dependencies";
|
||||||
};
|
};
|
||||||
|
packageOpts = mkOption {
|
||||||
|
type = optFunctionTo types.attrs;
|
||||||
|
default = {};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
config = mkMerge [
|
config = mkMerge [
|
||||||
|
|
@ -167,14 +171,14 @@ warnIf (! builtins ? readFileType) "Unsupported Nix version in use."
|
||||||
pname = tomlPackage.name;
|
pname = tomlPackage.name;
|
||||||
|
|
||||||
packages = {
|
packages = {
|
||||||
default = { craneLib, cargoArtifacts, defaultMeta, pkgs }: craneLib.buildPackage {
|
default = { callPackage, craneLib, cargoArtifacts, defaultMeta, pkgs }: craneLib.buildPackage ({
|
||||||
src = filteredSrc;
|
src = filteredSrc;
|
||||||
inherit cargoArtifacts;
|
inherit cargoArtifacts;
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
strictDeps = true;
|
strictDeps = true;
|
||||||
meta = defaultMeta;
|
meta = defaultMeta;
|
||||||
inherit ((buildDeps pkgs)) buildInputs nativeBuildInputs;
|
inherit ((buildDeps pkgs)) buildInputs nativeBuildInputs;
|
||||||
};
|
} // (config.packageOpts pkgs));
|
||||||
} // (genAttrs config.crossTargets (
|
} // (genAttrs config.crossTargets (
|
||||||
target: { craneLibForTargets, cargoArtifacts, defaultMeta, callPackage, crateName, pkgs }:
|
target: { craneLibForTargets, cargoArtifacts, defaultMeta, callPackage, crateName, pkgs }:
|
||||||
let
|
let
|
||||||
|
|
@ -193,7 +197,7 @@ warnIf (! builtins ? readFileType) "Unsupported Nix version in use."
|
||||||
pname = "${crateName}-${target}";
|
pname = "${crateName}-${target}";
|
||||||
cargoExtraArgs = "--target ${target}";
|
cargoExtraArgs = "--target ${target}";
|
||||||
inherit ((buildDeps pkgs)) buildInputs nativeBuildInputs;
|
inherit ((buildDeps pkgs)) buildInputs nativeBuildInputs;
|
||||||
} // crossArgs)
|
} // crossArgs // (config.packageOpts pkgs))
|
||||||
));
|
));
|
||||||
|
|
||||||
outputs = {
|
outputs = {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue