[Nix-dev] Accessing files in derivations.

Domen Kožar domen at dev.si
Tue Apr 19 16:26:30 CEST 2016


Funny, Aszlig just came up with the same idea yesterday.

Using ${foo => bin/blah} as syntax.

On Tue, Apr 19, 2016 at 3:01 PM, Layus <layus.on at gmail.com> wrote:

> Dear NixOS users,
>
> For as long as NixOS exists, we have been using statements like
> "${package}/some/path";
> However, nothing ensures that the path /some/path exists in the given
> package.
> As this works good enough in practice, there was no incentive to improve
> the situation.
>
> With the multiple output feature, it becomes even more cumbersome to use
> that notation,
> as we now have to write "${package.output}/some/path" to target the
> right file.
> Furthermore, if the packager decides to add an output and move some
> files to it, it may break the expression.
>
> This is why I think we should introduce a notation for accessing paths
> in derivations.
> Sadly, the "obvious" operators like //, <...> or @ are already taken.
> What about overloading them, as in ${package @ /some/path},
> "${package//some/path } or <package/some/path> ?
>
> That operator would ensure that the path exists in the derivation, but
> also look up through the outputs to find one containing that file.
> That way, adding and removing outputs to derivations would not break
> NixOS on each update,
> and we would have proper checking for static paths.
>
> Regards,
> Layus.
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20160419/1d3d9cf1/attachment-0001.html 


More information about the nix-dev mailing list