mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-09-30 11:50:06 +00:00
prefetch-npm-deps: support NIX_BUILD_CORES
(cherry picked from commit 9af0383296)
This commit is contained in:
@@ -182,6 +182,18 @@ fn main() -> anyhow::Result<()> {
|
||||
process::exit(1);
|
||||
}
|
||||
|
||||
if let Ok(jobs) = env::var("NIX_BUILD_CORES") {
|
||||
if !jobs.is_empty() {
|
||||
rayon::ThreadPoolBuilder::new()
|
||||
.num_threads(
|
||||
jobs.parse()
|
||||
.expect("NIX_BUILD_CORES must be a whole number"),
|
||||
)
|
||||
.build_global()
|
||||
.unwrap();
|
||||
}
|
||||
}
|
||||
|
||||
if args[1] == "--fixup-lockfile" {
|
||||
let lock = serde_json::from_str(&fs::read_to_string(&args[2])?)?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user