2022-10-21 18:38:19 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitLab
|
|
|
|
, installShellFiles
|
|
|
|
, pam
|
|
|
|
, nixosTests
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "please";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "0.5.5";
|
2022-10-21 18:38:19 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "edneville";
|
|
|
|
repo = "please";
|
|
|
|
rev = "v${version}";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-bQ91uCDA2HKuiBmHZ9QP4V6tM6c7hRvECqXzfC6EEnI=";
|
2022-10-21 18:38:19 +00:00
|
|
|
};
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
cargoHash = "sha256-PheqGFkXd5lQLMfrmH+TS0jfHdGPym/pTSh5Y2ZIHqw=";
|
2022-10-21 18:38:19 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
|
|
|
buildInputs = [ pam ];
|
|
|
|
|
|
|
|
patches = [ ./nixos-specific.patch ];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
installManPage man/*
|
|
|
|
'';
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
# Unit tests are broken on NixOS.
|
|
|
|
doCheck = false;
|
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
passthru.tests = { inherit (nixosTests) please; };
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Polite regex-first sudo alternative";
|
2022-10-21 18:38:19 +00:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|