16 , withDefaultFeatures ? true
17 , additionalFeatures ? (p: p)
27 rustPlatform.buildRustPackage {
31 src = fetchFromGitHub {
35 hash = "sha256-FHTOibm8p8hFvopFgBO3yWBSc9Gk8WroraxV/1Jhar0=";
38 cargoHash = "sha256-/saQSOBAAxkvtxsboFpEYUNCUzTgMRbLS1B2wZgX6oY=";
40 nativeBuildInputs = [ pkg-config ]
41 ++ lib.optionals (withDefaultFeatures && stdenv.isLinux) [ python3 ]
42 ++ lib.optionals stdenv.isDarwin [ rustPlatform.bindgenHook ];
44 buildInputs = [ openssl zstd ]
45 ++ lib.optionals stdenv.isDarwin [ zlib Libsystem Security ]
46 ++ lib.optionals (withDefaultFeatures && stdenv.isLinux) [ xorg.libX11 ]
47 ++ lib.optionals (withDefaultFeatures && stdenv.isDarwin) [ AppKit nghttp2 libgit2 ];
49 buildNoDefaultFeatures = !withDefaultFeatures;
50 buildFeatures = additionalFeatures [ ];
52 doCheck = ! stdenv.isDarwin; # Skip checks on darwin. Failing tests since 0.96.0
57 # The skipped tests all fail in the sandbox because in the nushell test playground,
58 # the tmp $HOME is not set, so nu falls back to looking up the passwd dir of the build
59 # user (/var/empty). The assertions however do respect the set $HOME.
61 HOME=$(mktemp -d) cargo test -j $NIX_BUILD_CORES --offline -- \
62 --test-threads=$NIX_BUILD_CORES \
63 --skip=repl::test_config_path::test_default_config_path \
64 --skip=repl::test_config_path::test_xdg_config_bad \
65 --skip=repl::test_config_path::test_xdg_config_empty
71 shellPath = "/bin/nu";
72 tests.version = testers.testVersion {
75 updateScript = nix-update-script { };
79 description = "Modern shell written in Rust";
80 homepage = "https://www.nushell.sh/";
81 license = licenses.mit;
82 maintainers = with maintainers; [ Br1ght0ne johntitor joaquintrinanes ];