summaryrefslogtreecommitdiffstats
path: root/krebs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2016-11-25 00:15:13 +0100
committertv <tv@krebsco.de>2016-11-25 00:16:44 +0100
commitd59facd88c7d33d0ac125eb93392d2a67b46aea4 (patch)
tree02d8068ff0c1a38acf5472d592a7057111d9c3b2 /krebs
parent51fcdfac0aa76228f6e17342513e15c772b9e84d (diff)
writeOut: add support for text checking
Diffstat (limited to 'krebs')
-rw-r--r--krebs/5pkgs/builders.nix4
1 files changed, 4 insertions, 0 deletions
diff --git a/krebs/5pkgs/builders.nix b/krebs/5pkgs/builders.nix
index 5860b9a15..77055d16a 100644
--- a/krebs/5pkgs/builders.nix
+++ b/krebs/5pkgs/builders.nix
@@ -91,6 +91,7 @@ rec {
writers.text =
{ path
+ , check ? null
, executable ? false
, mode ? if executable then "0755" else "0644"
, text
@@ -102,6 +103,9 @@ rec {
var = "file_${hashString "sha1" path}";
val = text;
install = /* sh */ ''
+ ${optionalString (check != null) /* sh */ ''
+ ${check} ''$${var}Path
+ ''}
${pkgs.coreutils}/bin/install -m ${mode} -D ''$${var}Path $out${path}
'';
};