nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1# fixed output derrivation adapted from
2# https://github.com/NixOS/nixpkgs/blob/28c3f83a9a77e3ada57afb71cc4052d2c435597a/pkgs/by-name/op/opencode/package.nix#L59-L122
3{
4 lib,
5 stdenvNoCC,
6 equibop,
7 bun,
8 writableTmpDirAsHomeHook,
9}:
10stdenvNoCC.mkDerivation {
11 inherit (equibop) version src;
12 pname = equibop.pname + "-modules";
13
14 impureEnvVars = lib.fetchers.proxyImpureEnvVars ++ [
15 "GIT_PROXY_COMMAND"
16 "SOCKS_SERVER"
17 ];
18
19 nativeBuildInputs = [
20 bun
21 writableTmpDirAsHomeHook
22 ];
23
24 dontConfigure = true;
25 dontFixup = true;
26
27 buildPhase = ''
28 runHook preBuild
29
30 export BUN_INSTALL_CACHE_DIR=$(mktemp -d)
31
32 bun install \
33 --filter=equibop \
34 --force \
35 --frozen-lockfile \
36 --ignore-scripts \
37 --linker=hoisted \
38 --no-progress
39
40 runHook postBuild
41 '';
42
43 installPhase = ''
44 runHook preInstall
45
46 cp -R ./node_modules $out
47
48 runHook postInstall
49 '';
50
51 outputHash =
52 {
53 x86_64-linux = "sha256-YqUAP11oSxfKifa8QL4VXGCWV5xGG2+vk60f4NdIXIA=";
54 aarch64-linux = "sha256-q7adhMY95g5BCcoiCVIwCpnqJAidE4a2cxGOjuE2YDk=";
55 }
56 .${stdenvNoCC.hostPlatform.system}
57 or (throw "Unsupported system ${stdenvNoCC.hostPlatform.system}");
58 outputHashAlgo = "sha256";
59 outputHashMode = "recursive";
60}