Part of: https://github.com/NixOS/nixpkgs/issues/108938 meta = with stdenv.lib; is a widely used pattern. We want to slowly remove the `stdenv.lib` indirection and encourage people to use `lib` directly. Thus let’s start with the meta field. This used a rewriting script to mostly automatically replace all occurances of this pattern, and add the `lib` argument to the package header if it doesn’t exist yet. The script in its current form is available at https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
33 lines
780 B
Nix
33 lines
780 B
Nix
{ lib, stdenv, fetchFromGitHub, python3 }:
|
|
|
|
stdenv.mkDerivation {
|
|
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 lib; {
|
|
description = "nginx config file formatter";
|
|
maintainers = with maintainers; [ Baughn ];
|
|
license = licenses.asl20;
|
|
homepage = "https://github.com/1connect/nginx-config-formatter";
|
|
};
|
|
}
|