[Nix-dev] fixed-output derivation that *also* depend on (some of) its inputs?

Bjørn Forsman bjorn.forsman at gmail.com
Sat Sep 20 20:34:40 CEST 2014


Hi,

How difficult is it to implement this?

While packaging an application that downloads a bunch of dependencies
during the build (like all grails apps do), I realized that I needed
this. What I did first was to write a fixed-output derivation to let
the application download its deps. Then I "locked it down" by fixing
the hash.

But now the problem is that even when the application changes its
dependency specification, nix will not attempt to download the new
deps, because it *only* looks at the output hash. I really need it to
consider some of its inputs too, because the dependency spec comes
from the input (application source).

IMHO, something like this could also be useful for fetchurl: Let's say
we made it also depend on the *basename* of url, then it'd re-download
on package bumps but *not* on mirror updates. (The fact that fetchurl
ignores package bumps is slightly confusing.)

Best regards,
Bjørn Forsman


More information about the nix-dev mailing list