1{ lib
2, rustPlatform
3, fetchFromGitLab
4, installShellFiles
5, pam
6, nixosTests
7}:
8
9rustPlatform.buildRustPackage rec {
10 pname = "please";
11 version = "0.5.4";
12
13 src = fetchFromGitLab {
14 owner = "edneville";
15 repo = "please";
16 rev = "v${version}";
17 hash = "sha256-GW2t3pTX06mqEwFTpiLe3mlzFTmb5Fep5R0yHooRmig=";
18 };
19
20 cargoHash = "sha256-bd3Pc8QPyPjE+xVcwASDILTXvMCioId/n6dXSr/KDOQ=";
21
22 nativeBuildInputs = [ installShellFiles ];
23
24 buildInputs = [ pam ];
25
26 patches = [ ./nixos-specific.patch ];
27
28 postInstall = ''
29 installManPage man/*
30 '';
31
32 # Unit tests are broken on NixOS.
33 doCheck = false;
34
35 passthru.tests = { inherit (nixosTests) please; };
36
37 meta = with lib; {
38 description = "A polite regex-first sudo alternative";
39 longDescription = ''
40 Delegate accurate least privilege access with ease. Express easily with a
41 regex and expose only what is needed and nothing more. Or validate file
42 edits with pleaseedit.
43
44 Please is written with memory safe rust. Traditional C memory unsafety is
45 avoided, logic problems may exist but this codebase is relatively small.
46 '';
47 homepage = "https://www.usenix.org.uk/content/please.html";
48 changelog = "https://github.com/edneville/please/blob/${src.rev}/CHANGELOG.md";
49 license = licenses.gpl3Only;
50 maintainers = with maintainers; [ azahi ];
51 platforms = platforms.linux;
52 };
53}