16 , withDefaultFeatures ? true
17 , additionalFeatures ? (p: p)
27 rustPlatform.buildRustPackage {
31 src = fetchFromGitHub {
34 rev = "refs/tags/${version}";
35 hash = "sha256-amPQJW8ofSMh2cQQrqPNOp/p33KwPNX7fpZ4SiJGQHU=";
38 cargoHash = "sha256-AblXOeSJGqrZY5aRzdst9F+ZB++/3Adu7Kri5lDsDH8=";
40 nativeBuildInputs = [ pkg-config ]
41 ++ lib.optionals (withDefaultFeatures && stdenv.hostPlatform.isLinux) [ python3 ]
42 ++ lib.optionals stdenv.hostPlatform.isDarwin [ rustPlatform.bindgenHook ];
44 buildInputs = [ openssl zstd ]
45 ++ lib.optionals stdenv.hostPlatform.isDarwin [ zlib Libsystem Security ]
46 ++ lib.optionals (withDefaultFeatures && stdenv.hostPlatform.isLinux) [ xorg.libX11 ]
47 ++ lib.optionals (withDefaultFeatures && stdenv.hostPlatform.isDarwin) [ AppKit nghttp2 libgit2 ];
49 buildNoDefaultFeatures = !withDefaultFeatures;
50 buildFeatures = additionalFeatures [ ];
52 doCheck = ! stdenv.hostPlatform.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 ];