mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 00:43:20 +00:00
trivial: make pkgs.writeText always fixed output
This can prevent a cascade of rebuilds across nixpkgs versions because these small files tend to be found at the leaves of dependency trees.
This commit is contained in:
parent
5aa55272c2
commit
9f4b1064c6
@ -133,7 +133,14 @@ rec {
|
||||
pkgs.writeText ${lib.strings.escapeNixString name}: The second argument should be a string, but it's a ${builtins.typeOf text} instead.'';
|
||||
lib.warnIf (! lib.isString text) ''
|
||||
pkgs.writeText ${lib.strings.escapeNixString name}: The second argument should be a string, but it's a ${builtins.typeOf text} instead, which is deprecated. Use `toString` to convert the value to a string first.''
|
||||
writeTextFile { inherit name text; };
|
||||
writeTextFile {
|
||||
inherit name text;
|
||||
derivationArgs = rec {
|
||||
outputHashAlgo = "sha256";
|
||||
outputHashMode = "flat";
|
||||
outputHash = builtins.hashString outputHashAlgo (builtins.toString text);
|
||||
};
|
||||
};
|
||||
|
||||
# See doc/build-helpers/trivial-build-helpers.chapter.md
|
||||
# or https://nixos.org/manual/nixpkgs/unstable/#trivial-builder-text-writing
|
||||
|
Loading…
Reference in New Issue
Block a user