git.iko.soy/typeable/nixpkgs
on master help sign in
emptyFile, emptyDirectory: init
commit047fe2fe23a902c777e10ba37534b8a1b7072a1e authorRobert Hensing <robert@roberthensing.nl> dateSat 12 Jun 2021, 17:28 (5 years ago) parent432fc2d
1 file changed+16
pkgs/build-support/trivial-builders.nix+16
pkgs/build-support/trivial-builders.nix+16
@@ -571,6 +571,22 @@ rec {
571571 installPhase = "cp -R ./ $out";
572572 };
573573
574+ /* An immutable file in the store with a length of 0 bytes. */
575+ emptyFile = runCommand "empty-file" {
576+ outputHashAlgo = "sha256";
577+ outputHashMode = "recursive";
578+ outputHash = "0ip26j2h11n1kgkz36rl4akv694yz65hr72q4kv4b3lxcbi65b3p";
579+ preferLocalBuild = true;
580+ } "touch $out";
581+
582+ /* An immutable empty directory in the store. */
583+ emptyDirectory = runCommand "empty-directory" {
584+ outputHashAlgo = "sha256";
585+ outputHashMode = "recursive";
586+ outputHash = "0sjjj9z1dhilhpc8pq4154czrb79z9cm044jvn75kxcjv6v5l2m5";
587+ preferLocalBuild = true;
588+ } "mkdir $out";
589+
574590 /* Checks the command output contains the specified version
575591 *
576592 * Although simplistic, this test assures that the main program