aboutsummaryrefslogtreecommitdiff
path: root/modules/pkgs/writeBashScript.nix
blob: b1931226a019e33f9e9a9b914f06bd0c1a34b2fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{ bash, writeTextFile, haskellPackages }:

let

  shellcheck = haskellPackages.ShellCheck;

in

name: text:
  writeTextFile
  {
    inherit name;
    executable = true;
    text = ''
      #!${bash}/bin/bash
      ${text}
    '';
    checkPhase = ''
      ${shellcheck}/bin/shellcheck "$out"
    '';
  }