cleverca22
7/4/2016 - 1:31 AM

gistfile1.txt

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;
}