Files

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

33 lines
465 B
Nix
Raw Permalink Normal View History

2025-10-09 14:15:47 +02:00
{
lib,
zig,
runCommand,
}:
{
pname,
version,
name ? "${pname}-${version}",
src,
hash ? lib.fakeHash,
}@args:
runCommand "${name}-zig-deps"
{
inherit (args) src;
nativeBuildInputs = [ zig ];
outputHashAlgo = null;
outputHashMode = "recursive";
outputHash = hash;
}
''
export ZIG_GLOBAL_CACHE_DIR=$(mktemp -d)
runHook unpackPhase
cd $sourceRoot
zig build --fetch
mv $ZIG_GLOBAL_CACHE_DIR/p $out
''