tirith: init at 0.1.8 (#486700)
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
{
|
||||
rustPlatform,
|
||||
fetchFromGitHub,
|
||||
lib,
|
||||
stdenv,
|
||||
installShellFiles,
|
||||
versionCheckHook,
|
||||
}:
|
||||
rustPlatform.buildRustPackage (final: {
|
||||
pname = "tirith";
|
||||
version = "0.1.8";
|
||||
src = fetchFromGitHub {
|
||||
owner = "sheeki03";
|
||||
repo = "tirith";
|
||||
tag = "v${final.version}";
|
||||
hash = "sha256-B/NiA7tag66wCvJMCX8oNeDiJDZVdPgOg8dhSaIGAJs=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-DKVuZuBQ1RAfcuwSdaTq4ke6qjTXe99kPcbPz25SCPM=";
|
||||
|
||||
cargoBuildFlags = [
|
||||
"-p"
|
||||
"tirith"
|
||||
];
|
||||
|
||||
checkFlags = [
|
||||
# requires a fully functional shell environment, generating init scripts needs a patch under nix to work at build time
|
||||
"--skip=init_bash_output"
|
||||
"--skip=init_zsh_output"
|
||||
];
|
||||
|
||||
nativeBuildInputs = lib.optionals (stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
|
||||
installShellFiles
|
||||
];
|
||||
nativeInstallCheckInputs = [ versionCheckHook ];
|
||||
doInstallCheck = true;
|
||||
|
||||
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||
installShellCompletion --cmd tirith \
|
||||
--bash <("$out/bin/tirith" completions bash) \
|
||||
--zsh <("$out/bin/tirith" completions zsh) \
|
||||
--fish <("$out/bin/tirith" completions fish)
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "Shell security tool that guards against homograph URL attacks, pipe-to-shell exploits, and other command-line threats before they execute";
|
||||
homepage = "https://github.com/sheeki03/tirith";
|
||||
changelog = "https://github.com/sheeki03/tirith/blob/${final.src.tag}/CHANGELOG.md";
|
||||
license = lib.licenses.agpl3Only;
|
||||
maintainers = with lib.maintainers; [ toasteruwu ];
|
||||
platforms = lib.platforms.unix;
|
||||
mainProgram = "tirith";
|
||||
};
|
||||
})
|
||||
Reference in New Issue
Block a user