@@ -1,4 +1,4 @@
1−{ stdenv, rustPlatform, fetchFromGitHub, Security }:
1+{ stdenv, rustPlatform, fetchFromGitHub, installShellFiles, Security }:
22
33rustPlatform.buildRustPackage rec {
44 pname = "rage";
@@ -13,8 +13,20 @@ rustPlatform.buildRustPackage rec {
1313
1414 cargoSha256 = "08njl8irkqkfxj54pz4sx3l9aqb40h10wxb82zza52pqd4zapgn6";
1515
16+ nativeBuildInputs = [ installShellFiles ];
17+
1618 buildInputs = stdenv.lib.optionals stdenv.isDarwin [ Security ];
1719
20+ postBuild = ''
21+ cargo run --example generate-docs
22+ cargo run --example generate-completions
23+ '';
24+
25+ postInstall = ''
26+ installManPage target/manpages/*
27+ installShellCompletion target/completions/*.{bash,fish,zsh}
28+ '';
29+
1830 meta = with stdenv.lib; {
1931 description = "A simple, secure and modern encryption tool with small explicit keys, no config options, and UNIX-style composability";
2032 homepage = "https://github.com/str4d/rage";