Open Fuuzetsu opened 1 year ago
Ah, actually it's even worse: pkgs.jq.out
does not work as it seems to produce empty link. So probably we're forced to do a nix wrapper that symlinks ${pkgs.jq.bin}/bin/jq
and build that or something.
Ah, actually it's even worse:
pkgs.jq.out
does not work as it seems to produce empty link. So probably we're forced to do a nix wrapper that symlinks${pkgs.jq.bin}/bin/jq
and build that or something.
nix.rules.build(
name = "jq",
expr = """
pkgs.runCommand "jq" { } ''
mkdir -p "$out"/bin
ln -s ${pkgs.jq.bin}/bin/jq "$out"/bin
''
""",
visibility = [ "root//..." ],
)
Seems to do it.
Honestly the .build
rule should be changed to take a list of output attrs that the expression is intended to produce (out/lib/bin/whatever) and then there should be a provider object returned for each of those symlinks. This assumes mkDerivation
of course but hey that's life.
Unfortunately this is a case where we have to duplicate the information between the expression and Buck files, I think. But maybe it's possible to use dynamic_outputs
to fix this, but at a glance I'm not sure.
If I try to do the below
and use it somewhere, it will fail:
because
A workaround is to use
pkgs.jq.out
as theexpr
.pkgs.jq.bin
does not work.Maybe at least add a field which allows to specify the link name so it's a middle-ground?