1{
2 lib,
3 stdenv,
4 rustPlatform,
5 fetchFromGitHub,
6 installShellFiles,
7}:
8
9rustPlatform.buildRustPackage rec {
10 pname = "rage";
11 version = "0.11.1";
12
13 src = fetchFromGitHub {
14 owner = "str4d";
15 repo = "rage";
16 rev = "v${version}";
17 hash = "sha256-aZs1iqfpsiMuhxXNqRatpKD99eDBCsWHk4OPpnnaB70=";
18 };
19
20 cargoHash = "sha256-GdvqkB/jHAGUbzhOLPkIX664JJH3WrZZtv+/E/PhTR8=";
21
22 nativeBuildInputs = [
23 installShellFiles
24 ];
25
26 # cargo test has an x86-only dependency
27 doCheck = stdenv.hostPlatform.isx86;
28
29 postInstall = ''
30 installManPage target/*/release/manpages/man1/*
31 installShellCompletion \
32 --bash target/*/release/completions/*.bash \
33 --fish target/*/release/completions/*.fish \
34 --zsh target/*/release/completions/_*
35 '';
36
37 meta = {
38 description = "Simple, secure and modern encryption tool with small explicit keys, no config options, and UNIX-style composability";
39 homepage = "https://github.com/str4d/rage";
40 changelog = "https://github.com/str4d/rage/blob/v${version}/rage/CHANGELOG.md";
41 license = with lib.licenses; [
42 asl20
43 mit
44 ]; # either at your option
45 maintainers = with lib.maintainers; [ ryantm ];
46 mainProgram = "rage";
47 };
48}