mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-10 15:04:44 +00:00
aa22fa9c0b
Add writeStringReferencesToFile, a builder which extracts a string's references to derivations and paths and writes them to a text file, removing the input string itself from the dependency graph. This is useful when you want to make a derivation depend on the string's references, but not its content (to avoid unnecessary rebuilds, for example).
26 lines
544 B
Nix
26 lines
544 B
Nix
{ pkgs ? import ../../../.. { config = {}; overlays = []; } }:
|
|
let
|
|
inherit (pkgs)
|
|
figlet
|
|
zlib
|
|
hello
|
|
writeText
|
|
;
|
|
in
|
|
{
|
|
hello = hello;
|
|
figlet = figlet;
|
|
zlib = zlib;
|
|
zlib-dev = zlib.dev;
|
|
norefs = writeText "hi" "hello";
|
|
norefsDup = writeText "hi" "hello";
|
|
helloRef = writeText "hi" "hello ${hello}";
|
|
helloRefDup = writeText "hi" "hello ${hello}";
|
|
path = ./invoke-writeReferencesToFile.nix;
|
|
helloFigletRef = writeText "hi" "hello ${hello} ${figlet}";
|
|
inherit (pkgs)
|
|
emptyFile
|
|
emptyDirectory
|
|
;
|
|
}
|