[Nix-dev] [nix language] strings that have paths/derivations embedded

Mathijs Kwik mathijs at bluescreen303.nl
Tue Oct 9 13:07:42 CEST 2012


On Tue, Oct 9, 2012 at 12:18 PM, Marc Weber <marco-oweber at gmx.de> wrote:
> Excerpts from Mathijs Kwik's message of Tue Oct 09 12:09:33 +0200 2012:
>> I found the scary-sounding function "unsafeDiscardStringContext",
>> which seems to work around this problem.
>> Can someone please shed some light on what's going on (or nix
>> string/context handling in general) and if it that function is safe to
>> use for this case.
>
> Example:
>
> yourderivation {
>   name =
>
>   scritp = ''
>   ${unsafeDiscardStringContext otherDerivation}
>   '';
> }
>
> AFAIK this should not build otherDerivation, but pass the store path of
> otherDerivation.

Cool, I make sure that any derivations mentioned in these strings get
built in another place already, so I guess this is fine and safe to
use.


>
> Marc Weber
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev


More information about the nix-dev mailing list