12 shab = stdenv.mkDerivation {
16 src = fetchFromGitHub {
20 hash = "sha256-UW4tRZSir7KG7KXg0sOCd8kkIydEwZ6kdwxCeo0Ojgo=";
24 for f in test.sh test/*.sh; do
30 doInstallCheck = true;
38 cp ./shab $out/bin/shab
41 installCheckPhase = ''
42 [[ "$(echo 'Hello $entity' | entity=world $out/bin/shab)" == 'Hello world' ]]
46 inherit render renderText;
50 description = "Bash templating language";
52 homepage = "https://github.com/zimbatm/shab";
53 license = licenses.unlicense;
54 maintainers = with maintainers; [ zimbatm ];
55 platforms = bash.meta.platforms;
60 shabScript: a path or filename to use as a template
61 parameters.name: the name to use as part of the store path
62 parameters: variables to expose to the template
65 shabScript: parameters:
71 runCommand "out" (parameters // extraParams) ''
72 ${shab}/bin/shab "$shabScript" >$out
76 shabScriptText: a string to use as a template
77 parameters.name: the name to use as part of the store path
78 parameters: variables to expose to the template
80 renderText = shabScriptText: parameters: render (writeText "template" shabScriptText) parameters;