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

This commit is contained in:
pinage404
2025-12-11 16:09:08 +01:00
parent 89607b14e9
commit c1eb402afd
+22
View File
@@ -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 = {