17 withDefaultFeatures ? true,
18 additionalFeatures ? (p: p),
28 rustPlatform.buildRustPackage {
32 src = fetchFromGitHub {
35 rev = "refs/tags/${version}";
36 hash = "sha256-lbVvKpaG9HSm2W+NaVUuEOxTNUIf0iRATTVDKFPjqV4=";
39 cargoHash = "sha256-omC/qcpgy65Md1MC0QGUVCRVNl9sWlFcCRxdS4aeU+g=";
43 ++ lib.optionals (withDefaultFeatures && stdenv.hostPlatform.isLinux) [ python3 ]
44 ++ lib.optionals stdenv.hostPlatform.isDarwin [ rustPlatform.bindgenHook ];
51 ++ lib.optionals stdenv.hostPlatform.isDarwin [
56 ++ lib.optionals (withDefaultFeatures && stdenv.hostPlatform.isLinux) [ xorg.libX11 ]
57 ++ lib.optionals (withDefaultFeatures && stdenv.hostPlatform.isDarwin) [
63 buildNoDefaultFeatures = !withDefaultFeatures;
64 buildFeatures = additionalFeatures [ ];
66 doCheck = !stdenv.hostPlatform.isDarwin; # Skip checks on darwin. Failing tests since 0.96.0
71 # The skipped tests all fail in the sandbox because in the nushell test playground,
72 # the tmp $HOME is not set, so nu falls back to looking up the passwd dir of the build
73 # user (/var/empty). The assertions however do respect the set $HOME.
75 HOME=$(mktemp -d) cargo test -j $NIX_BUILD_CORES --offline -- \
76 --test-threads=$NIX_BUILD_CORES \
77 --skip=repl::test_config_path::test_default_config_path \
78 --skip=repl::test_config_path::test_xdg_config_bad \
79 --skip=repl::test_config_path::test_xdg_config_empty
85 shellPath = "/bin/nu";
86 tests.version = testers.testVersion {
89 updateScript = nix-update-script { };
93 description = "Modern shell written in Rust";
94 homepage = "https://www.nushell.sh/";
95 license = licenses.mit;
96 maintainers = with maintainers; [