2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, python3 }:
|
2017-01-27 15:52:20 +00:00
|
|
|
|
2022-10-08 17:10:26 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
version = "1.2.2";
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "nginx-config-formatter";
|
2017-01-27 15:52:20 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2022-10-08 17:10:26 +00:00
|
|
|
owner = "slomkowski";
|
2017-01-27 15:52:20 +00:00
|
|
|
repo = "nginx-config-formatter";
|
2022-10-08 17:10:26 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256-EUoOfkoVsNpIAwDaQ4NH8MkRIJZI8qeuuHUDE6LuLiI=";
|
2017-01-27 15:52:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ python3 ];
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
checkPhase = ''
|
|
|
|
python3 $src/test_nginxfmt.py
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
install -m 0755 $src/nginxfmt.py $out/bin/nginxfmt
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2017-01-27 15:52:20 +00:00
|
|
|
description = "nginx config file formatter";
|
2017-01-27 17:53:49 +00:00
|
|
|
maintainers = with maintainers; [ Baughn ];
|
2017-01-27 15:52:20 +00:00
|
|
|
license = licenses.asl20;
|
2022-10-08 17:10:26 +00:00
|
|
|
homepage = "https://github.com/slomkowski/nginx-config-formatter";
|
2017-01-27 15:52:20 +00:00
|
|
|
};
|
|
|
|
}
|