nixpkgs/pkgs/tools/security/please/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

54 lines
1.4 KiB
Nix
Raw Normal View History

2022-09-29 23:12:13 +02:00
{ lib
, rustPlatform
, fetchFromGitLab
, installShellFiles
, pam
, nixosTests
}:
rustPlatform.buildRustPackage rec {
pname = "please";
2023-04-01 16:49:26 +02:00
version = "0.5.4";
2022-09-29 23:12:13 +02:00
src = fetchFromGitLab {
owner = "edneville";
repo = "please";
rev = "v${version}";
2023-04-01 16:49:26 +02:00
hash = "sha256-GW2t3pTX06mqEwFTpiLe3mlzFTmb5Fep5R0yHooRmig=";
2022-09-29 23:12:13 +02:00
};
2023-04-01 16:49:26 +02:00
cargoHash = "sha256-bd3Pc8QPyPjE+xVcwASDILTXvMCioId/n6dXSr/KDOQ=";
2022-09-29 23:12:13 +02:00
nativeBuildInputs = [ installShellFiles ];
buildInputs = [ pam ];
patches = [ ./nixos-specific.patch ];
postInstall = ''
installManPage man/*
'';
2023-04-01 16:49:26 +02:00
# Unit tests are broken on NixOS.
doCheck = false;
passthru.tests = { inherit (nixosTests) please; };
2022-09-29 23:12:13 +02:00
meta = with lib; {
description = "A polite regex-first sudo alternative";
longDescription = ''
Delegate accurate least privilege access with ease. Express easily with a
regex and expose only what is needed and nothing more. Or validate file
edits with pleaseedit.
Please is written with memory safe rust. Traditional C memory unsafety is
avoided, logic problems may exist but this codebase is relatively small.
'';
homepage = "https://www.usenix.org.uk/content/please.html";
changelog = "https://github.com/edneville/please/blob/${src.rev}/CHANGELOG.md";
license = licenses.gpl3Only;
maintainers = with maintainers; [ azahi ];
platforms = platforms.linux;
};
}