nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ stdenv, lib, resholve, resholve-utils }:
2
3{ pname
4, src
5, version
6, passthru ? { }
7, solutions
8, ...
9}@attrs:
10let
11 inherit stdenv;
12
13 self = (stdenv.mkDerivation ((removeAttrs attrs [ "solutions" ])
14 // {
15 inherit pname version src;
16 buildInputs = (lib.optionals (builtins.hasAttr "buildInputs" attrs) attrs.buildInputs) ++ [ resholve ];
17
18 # enable below for verbose debug info if needed
19 # supports default python.logging levels
20 # LOGLEVEL="INFO";
21 /*
22 subshell/PS4/set -x and : command to output resholve envs
23 and invocation. Extra context makes it clearer what the
24 Nix API is doing, makes nix-shell debugging easier, etc.
25 */
26 preFixup = ''
27 (
28 cd "$out"
29 PS4=$'\x1f'"\033[33m[resholve context]\033[0m "
30 set -x
31 : changing directory to $PWD
32 ${builtins.concatStringsSep "\n" (resholve-utils.makeCommands solutions)}
33 )
34 '';
35 }));
36in
37lib.extendDerivation true passthru self