Commit c1eb402a authored by pinage404's avatar pinage404
Browse files

masklint: wrap with shell, python and ruby ; make it optional

parent 89607b14
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
@@ -2,8 +2,12 @@
  lib,
  rustPlatform,
  fetchFromGitHub,
  makeWrapper,
  withShell ? true,
  shellcheck,
  withPython ? true,
  ruff,
  withRuby ? true,
  rubocop,
  nix-update-script,
}:
@@ -30,6 +34,24 @@ rustPlatform.buildRustPackage {
    rubocop # ruby
  ];

  nativeBuildInputs = [ makeWrapper ];

  postInstall = (
    if (withShell || withPython || withRuby) then
      ''
        wrapProgram $out/bin/masklint \
          --prefix PATH : ${
            lib.makeBinPath (
              (lib.optional withShell shellcheck)
              ++ (lib.optional withPython ruff)
              ++ (lib.optional withRuby rubocop)
            )
          }
      ''
    else
      ""
  );

  passthru.updateScript = nix-update-script { };

  meta = {