diff options
author | Robert Hensing <robert@roberthensing.nl> | 2021-06-12 17:28:00 +0200 |
---|---|---|
committer | Robert Hensing <robert@roberthensing.nl> | 2021-06-12 17:28:00 +0200 |
commit | 047fe2fe23a902c777e10ba37534b8a1b7072a1e (patch) | |
tree | c078ec63d123350b37e520100d97b4380b08fa5b /pkgs/build-support/trivial-builders.nix | |
parent | 432fc2d9a67f92e05438dff5fdc2b39d33f77997 (diff) |
emptyFile, emptyDirectory: init
Diffstat (limited to 'pkgs/build-support/trivial-builders.nix')
-rw-r--r-- | pkgs/build-support/trivial-builders.nix | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/pkgs/build-support/trivial-builders.nix b/pkgs/build-support/trivial-builders.nix index 0bf67d21b3be6..219f808403ccd 100644 --- a/pkgs/build-support/trivial-builders.nix +++ b/pkgs/build-support/trivial-builders.nix @@ -571,6 +571,22 @@ rec { installPhase = "cp -R ./ $out"; }; + /* An immutable file in the store with a length of 0 bytes. */ + emptyFile = runCommand "empty-file" { + outputHashAlgo = "sha256"; + outputHashMode = "recursive"; + outputHash = "0ip26j2h11n1kgkz36rl4akv694yz65hr72q4kv4b3lxcbi65b3p"; + preferLocalBuild = true; + } "touch $out"; + + /* An immutable empty directory in the store. */ + emptyDirectory = runCommand "empty-directory" { + outputHashAlgo = "sha256"; + outputHashMode = "recursive"; + outputHash = "0sjjj9z1dhilhpc8pq4154czrb79z9cm044jvn75kxcjv6v5l2m5"; + preferLocalBuild = true; + } "mkdir $out"; + /* Checks the command output contains the specified version * * Although simplistic, this test assures that the main program |