cleverca22
7/20/2016 - 8:04 PM

import.nix

let
  pkgs = import <nixpkgs> {};
  foo = pkgs.writeTextFile {
    name = "foo";
    text = ''
      { stdenv, writeText }:
      writeText "bar" "the 2nd package"
    '';
    destination = "/default.nix";
  };
in {
  a = pkgs.callPackage foo {};
  b = foo;
}