[Nix-dev] obtaining the drv from an imported object

zimbatm zimbatm at zimbatm.com
Mon Oct 24 09:38:54 CEST 2016


I think what you want is something in this effect:

let src = fetchTarball ...; fractalide = import src {};
...
else import "${src}/support/vm" {}; ...

Alternatively you could require the user to set the fractalide source into
the NIX_PATH which gives her the choice of using a remote or local
checkout. NIX_PATH="$NIX_PATH fractalide=https://..."
In the code you can then access that using the <fractalide> notation.

On Sat, 22 Oct 2016, 19:17 stewart mackenzie, <setori88 at gmail.com> wrote:

> Greetings,
>
> I have a specialization repo for fractalide i.e. the repos may import
> each others components and contracts. They are just specializations /
> experimental places
> (https://github.com/fractalide/fractalide_external_opensource_example)
>
> I want the specialization repo to be importable by canonical i.e:
>
> https://github.com/fractalide/fractalide/blob/master/components/vendor/external/opensource/example/default.nix#L11
>
> and I also want the programmer to be able to `cd specialization/` and
> then build a vm right there instead of having to go into the
> fractalide repo to build the vm.
>
> This is the code I have so far for this repo
>
> https://github.com/fractalide/fractalide_external_opensource_example/default.nix
>
> { fractalide ? import (fetchTarball
> https://github.com/fractalide/fractalide/archive/master.tar.gz) {}
>   , pkgs ? fractalide.pkgs
>   , support ? fractalide.support
>   , contracts ? fractalide.contracts
>   , components ? fractalide.components}:
> let
>   publicComponentOrSubnet = allComponents.vendor_test_nand;
>   allContracts = contracts // import ./contracts {inherit pkgs support
> allContracts;};
>   allComponents = components // import ./components {inherit pkgs
> support allContracts allComponents;};
>   componentOrSubnetOrVm = if fractalide == null then
> publicComponentOrSubnet
>   else import fractalide { inherit pkgs support allContracts
> allComponents; exeSubnet = publicComponentOrSubnet;};
> in
> componentOrSubnetOrVm
>
> The line in question is this one:   else import fractalide { inherit
> pkgs support allContracts allComponents; exeSubnet =
> publicComponentOrSubnet;};
>
> I want to find the drv of fractalide so I can `else import
> fractalide.drv/support/vm { ...} (to that effect)
>
> where the path points to this file:
> https://github.com/fractalide/fractalide/blob/master/support/vm/default.nix
>
> How do I obtain the drv?
>
> Kind regards
> Stewart
> _______________________________________________
> 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/20161024/67b9155a/attachment.html>


More information about the nix-dev mailing list