Something went wrong. Try again.
What happens if I push all of nixpkgs
Something went wrong. Try again.
1.5 kB · 64 lines
Nix
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465{ lib, stdenvNoCC }:
/** A utility builder to get the source code of the input derivation, with any patches applied.
# Examples
```nix srcOnly pkgs.hello => «derivation /nix/store/gyfk2jg9079ga5g5gfms5i4h0k9jhf0f-hello-2.12.1-source.drv»
srcOnly { inherit (pkgs.hello) name version src stdenv; } => «derivation /nix/store/vf9hdhz38z7rfhzhrk0vi70h755fnsw7-hello-2.12.1-source.drv» ```
# Type
``` srcOnly :: (Derivation | AttrSet) -> Derivation ```
# Input
`attrs`
: One of the following:
- A derivation with (at minimum) an unpackPhase and a patchPhase. - A set of attributes that would be passed to a `stdenv.mkDerivation` or `stdenvNoCC.mkDerivation` call.
# Output
A derivation that runs a derivation's `unpackPhase` and `patchPhase`, and then copies the result to the output path.*/
attrs:let args = attrs.drvAttrs or attrs; name = args.name or "${args.pname}-${args.version}"; stdenv = args.stdenv or (lib.warn "srcOnly: stdenv not provided, using stdenvNoCC" stdenvNoCC); drv = stdenv.mkDerivation ( args // { name = "${name}-source";
outputs = [ "out" ];
phases = [ "unpackPhase" "patchPhase" "installPhase" ]; separateDebugInfo = false;
dontUnpack = false;
dontInstall = false; installPhase = "cp -pr --reflink=auto -- . $out"; } );inlib.warnIf (args.dontUnpack or false) "srcOnly: derivation has dontUnpack set, overriding" drv