1{
2 lib,
3 fetchFromGitHub,
4 rustPlatform,
5 installShellFiles,
6}:
7
8rustPlatform.buildRustPackage rec {
9 pname = "shadowenv";
10 version = "3.3.1";
11
12 src = fetchFromGitHub {
13 owner = "Shopify";
14 repo = "shadowenv";
15 rev = version;
16 hash = "sha256-s70tNeF0FnWYZ0xLGIL1lTM0LwJdhPPIHrNgrY1YNBs=";
17 };
18
19 cargoHash = "sha256-Cg01yM3FbrYpZrv2dhGJnezugNhcuwDcXIU47/AWrC4=";
20
21 nativeBuildInputs = [ installShellFiles ];
22
23 postInstall = ''
24 installManPage man/man1/shadowenv.1
25 installManPage man/man5/shadowlisp.5
26 installShellCompletion --bash sh/completions/shadowenv.bash
27 installShellCompletion --fish sh/completions/shadowenv.fish
28 installShellCompletion --zsh sh/completions/_shadowenv
29 '';
30
31 preCheck = ''
32 HOME=$TMPDIR
33 '';
34
35 meta = with lib; {
36 homepage = "https://shopify.github.io/shadowenv/";
37 description = "Reversible directory-local environment variable manipulations";
38 license = licenses.mit;
39 maintainers = [ ];
40 mainProgram = "shadowenv";
41 };
42}