[Nix-dev] obtaining the drv from an imported object
stewart mackenzie
setori88 at gmail.com
Mon Oct 24 10:28:37 CEST 2016
ah yes, this is my solution: https://github.com/fractalide/frac_example_wrangle
{ fractalide ? import <fractalide> {}
, pkgs ? fractalide.pkgs
, support ? fractalide.support
, contracts ? fractalide.contracts
, components ? fractalide.components}:
let
publicComponentOrSubnet = allComponents.example_wrangle; # expose
your public reusable subnet
exeSubnet = allComponents.example_wrangle; # a subnet containing
non-generic IIPs you don't want to expose to the community
allContracts = contracts // import ./contracts {inherit pkgs support
allContracts;};
allComponents = components // import ./components {inherit pkgs
support allContracts allComponents;};
in
if fractalide == null then publicComponentOrSubnet
else import (<fractalide> + "/support/vm/") {inherit pkgs support;
contracts = allContracts;
components = allComponents;
exeSubnet = exeSubnet;}
it was late, cause my brain wasn't working properly.
Thanks mate
kr/sjm
On Mon, Oct 24, 2016 at 3:38 PM, zimbatm <zimbatm at zimbatm.com> wrote:
> 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.
More information about the nix-dev
mailing list