[Nix-dev] Bundling nix-expressions with source code

Marc Weber marco-oweber at gmx.de
Tue Jan 22 13:31:28 CET 2013


Excerpts from Rickard Nilsson's message of Tue Jan 22 13:05:09 +0100 2013:
> I would like to bundle nix-expressions with some of my self-developed  
> programs, and just let nixpkgs (or some custom-nixpkgs) use the  
> nix-expression from the source when building the program. Is this a wise  
> thing to do? Is it even possible?
Why not?

You can always build using external files like this:

  let pkgs  = import /etc/nixos/nixpkgs {};
  in {
    pkgs.mkDerivation {
      ./your-source-whatsoever
    }
  }

The only issue if you have multiple packages depending on each other.

Usually whatever works is good :)

Marc Weber


More information about the nix-dev mailing list