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