Use stdenvNoCC in generated output

This reduces the build closure substantially since it no longer pulls
in the entire C build environment.

For example, using `build-project.nix`:

With `stdenv`:

    $ nix path-info --closure-size --human-readable $(nix-build --no-out-link -A inputDerivation build-project.nix)
    …
    /nix/store/v96sbzyinh0zfkk0c13i6dx3hkrlvds1-build-project-output	 322.5M

With `stdenvNoCC`:

    $ nix path-info --closure-size --human-readable $(nix-build --no-out-link -A inputDerivation build-project.nix)
    …
    /nix/store/9v3jldf3cnm204nw5w6szb8rvdxqhpsz-build-project-output	 108.0M
This commit is contained in:
Robert Helgesson 2021-11-08 00:22:50 +01:00
parent 874efd1d8e
commit 21ae03ddf4
No known key found for this signature in database
GPG Key ID: 36BDAA14C2797E89

View File

@ -173,7 +173,7 @@ in {
mkBuildProjectOutput =
{ src, purs }:
pkgs.stdenv.mkDerivation {
pkgs.stdenvNoCC.mkDerivation {
name = "build-project-output";
src = src;
@ -211,7 +211,7 @@ printResult (Fetched
<<< replace { from: "REV", to: rev }
<<< replace { from: "SHA256", to: sha256 }
$ """
"PKGNAME" = pkgs.stdenv.mkDerivation {
"PKGNAME" = pkgs.stdenvNoCC.mkDerivation {
name = "PKGNAME";
version = "VERSION";
src = pkgs.fetchgit {