nixpkgs/pkgs/build-support/trivial-builders/test/sample.nix
talyz aa22fa9c0b trivial-builders: Add writeStringReferencesToFile
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).
2021-10-28 12:55:01 +02:00

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
;
}