Skip to content

Instantly share code, notes, and snippets.

@grahamc
Created November 26, 2018 16:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grahamc/1cd2ec903dceed8f86815086c8e0c6d1 to your computer and use it in GitHub Desktop.
Save grahamc/1cd2ec903dceed8f86815086c8e0c6d1 to your computer and use it in GitHub Desktop.
let
pkgs = import <nixpkgs> {};
expr = pkgs.writeText "example.nix" ''
let pkgs = import ${pkgs.path} {}; in pkgs.ncurses
'';
in
pkgs.stdenv.mkDerivation {
name = "foo";
buildPhase = ''
nix-build ${expr}
cp ./result/*$out
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment