mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 14:54:29 +01:00
Merge pull request #126680 from roberth/empty
emptyFile, emptyDirectory: init
This commit is contained in:
commit
ab11d2114e
3 changed files with 21 additions and 1 deletions
|
@ -202,7 +202,7 @@ let
|
|||
let
|
||||
documentRoot = if hostOpts.documentRoot != null
|
||||
then hostOpts.documentRoot
|
||||
else pkgs.runCommand "empty" { preferLocalBuild = true; } "mkdir -p $out"
|
||||
else pkgs.emptyDirectory
|
||||
;
|
||||
|
||||
mkLocations = locations: concatStringsSep "\n" (map (config: ''
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -12,4 +12,8 @@ in
|
|||
norefs = writeText "hi" "hello";
|
||||
helloRef = writeText "hi" "hello ${hello}";
|
||||
helloFigletRef = writeText "hi" "hello ${hello} ${figlet}";
|
||||
inherit (pkgs)
|
||||
emptyFile
|
||||
emptyDirectory
|
||||
;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue