about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/misc/nginx-config-formatter/default.nix
blob: 91dd56c9b0f4f473f728b1d7e457f560d80bcb07 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{ stdenv, fetchFromGitHub, python3 }:

stdenv.mkDerivation rec {
  version = "2019-02-13";
  pname = "nginx-config-formatter";

  src = fetchFromGitHub {
    owner = "1connect";
    repo = "nginx-config-formatter";
    rev = "4ea6bbc1bdeb1d28419548aeca90f323e64e0e05";
    sha256 = "0h6pj9i0wim9pzkafi92l1nhlnl2a530vnm7qqi3n2ra8iwfyw4f";
  };

  buildInputs = [ python3 ];

  doCheck = true;
  checkPhase = ''
    python3 $src/test_nginxfmt.py
  '';

  installPhase = ''
    mkdir -p $out/bin
    install -m 0755 $src/nginxfmt.py $out/bin/nginxfmt
  '';

  meta = with stdenv.lib; {
    description = "nginx config file formatter";
    maintainers = with maintainers; [ Baughn ];
    license = licenses.asl20;
    homepage = https://github.com/1connect/nginx-config-formatter;
  };
}