[Nix-dev] Creating dependency trees.

stewart mackenzie setori88 at gmail.com
Fri Jan 22 03:20:11 CET 2016


Now that I have:

in => a nand (${maths_boolean_nand}) out => out
in => b nand (${})

Is there some way I can get nix to evaluate this newly created file?
i.e.

{ stdenv, genName, writeTextFile }:
  { src, ... } @ args:
  let
  name = genName src;
  text = src + "/lib.subnet";
  subnet-txt = writeTextFile {
    name = name;
    text = builtins.readFile text;
    executable = false;
  };
  in stdenv.mkDerivation  (args // {
    name = name;
    unpackPhase = "true";
    buildPhase = ''
      mkdir -p lib
      cp ${subnet-txt} lib/lib.subnet
      substituteInPlace lib/lib.subnet \
        --replace \( \ \(''$\{ \
        --replace \) \}\)
      >>> execute-some-nix-thing-to-expand-the-newly-created-${maths_boolean_nand}-in-lib.subnet-thus-creating-a-dependency
 >>>>
      cat lib/lib.subnet
    '';
    installPhase = ''
      mkdir -p $out/lib
      cp ${subnet-txt} $out/lib/lib.subnet'';
    })

It's probably better to do this another way!

Keen to hear your thoughts.


More information about the nix-dev mailing list