14 rustPlatform.buildRustPackage rec {
23 src = fetchFromGitHub {
26 rev = "refs/tags/${version}";
27 hash = "sha256-jIc8+SFAcH2TsY12+txwlMoJmpDdDpC0H+UrjYH61Lk=";
30 cargoHash = "sha256-JHLkjMy5b1spJrAqFCCzqgnlYTAKA1Z9Tx4w1WWuiAI=";
36 buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ libiconv ];
39 # USER must not be empty
41 export USERNAME=just-user
42 export JUST_CHOOSER="${coreutils}/bin/cat"
44 # Prevent string.rs from being changed
45 cp tests/string.rs $TMPDIR/string.rs
47 sed -i src/justfile.rs \
49 -e "s@/bin/echo@${coreutils}/bin/echo@g" \
50 -e "s@/usr/bin/env@${coreutils}/bin/env@g"
52 # Return unchanged string.rs
53 cp $TMPDIR/string.rs tests/string.rs
55 # For shell completion tests
56 export PATH=${bashInteractive}/bin:$PATH
61 ./fix-just-path-in-tests.patch
65 cargo run --package generate-book
67 mkdir -p completions man
69 cargo run -- --man > man/just.1
71 for shell in bash fish zsh; do
72 cargo run -- --completions $shell > completions/just.$shell
75 # No linkcheck in sandbox
76 echo 'optional = true' >> book/en/book.toml
82 "--skip=backticks::trailing_newlines_are_stripped" # Wants to use python3 as alternate shell
83 "--skip=choose::invoke_error_function" # wants JUST_CHOOSER to be fzf
84 "--skip=choose::default" # symlinks cat->fzf which fails as coreutils doesn't understand name
85 "--skip=config::tests::show_arguments" # interferes with JUST_CHOOSER being set
86 "--skip=edit::editor_precedence" # trying to run "vim" fails as there's no /usr/bin/env or which in the sandbox to find vim and the dependency is not easily patched
87 "--skip=shebang::run_shebang" # test case very rarely fails with "Text file busy"
91 mkdir -p $doc/share/doc/$name
92 mv ./book/en/build/html $doc/share/doc/$name
93 installManPage man/just.1
95 installShellCompletion --cmd just \
96 --bash completions/just.bash \
97 --fish completions/just.fish \
98 --zsh completions/just.zsh
101 setupHook = ./setup-hook.sh;
103 passthru.updateScript = nix-update-script { };
106 homepage = "https://github.com/casey/just";
107 changelog = "https://github.com/casey/just/blob/${version}/CHANGELOG.md";
108 description = "Handy way to save and run project-specific commands";
109 license = licenses.cc0;
110 maintainers = with maintainers; [
114 mainProgram = "just";