-
-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libSrc: introduce a derivation which is the nixpkgs lib source
- Loading branch information
1 parent
4f40c77
commit 1dc205b
Showing
3 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
# pkgs-lib is for functions and values that can't be in lib because | ||
# they depend on some packages. This notably is *not* for supporting package | ||
# building, instead pkgs/build-support is the place for that. | ||
{ lib, pkgs }: { | ||
{ lib, pkgs }: | ||
|
||
{ | ||
# setting format types and generators. These do not fit in lib/types.nix, | ||
# because they depend on pkgs for rendering some formats | ||
formats = import ./formats.nix { | ||
inherit lib pkgs; | ||
}; | ||
|
||
libSrc = pkgs.callPackage ./lib-src.nix { }; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ lib, stdenvNoCC }: | ||
|
||
# Produces a derivation which contains **just** the top-level `lib` directory in `nixpkgs`, | ||
# but maintains the same structure, so it's in the `$out/lib` == `./lib`. | ||
# | ||
# This allows Nix-using derivations inside Nixpkgs to be rebuilt when `lib` changes but not | ||
# for other changes in the tree. | ||
stdenvNoCC.mkDerivation { | ||
name = "nixpkgs-lib"; | ||
|
||
src = lib.fileset.toSource { | ||
root = ../..; | ||
fileset = ../../lib; | ||
}; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
mkdir $out | ||
cp -ar $src/* $out | ||
runHook postInstall | ||
''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters