From 9c5bd81d0d776b3447ca4500f2f12682399d6829 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 2 Feb 2026 14:00:07 +0000 Subject: [PATCH 1/3] nushell: cleanup --- pkgs/by-name/nu/nushell/package.nix | 57 ++++++++++++++++------------- 1 file changed, 32 insertions(+), 25 deletions(-) diff --git a/pkgs/by-name/nu/nushell/package.nix b/pkgs/by-name/nu/nushell/package.nix index 4e5a2f2b24b9..43a1b5477937 100644 --- a/pkgs/by-name/nu/nushell/package.nix +++ b/pkgs/by-name/nu/nushell/package.nix @@ -17,22 +17,20 @@ nushell, nix-update-script, curlMinimal, + writableTmpDirAsHomeHook, }: -let +rustPlatform.buildRustPackage (finalAttrs: { + pname = "nushell"; # NOTE: when updating this to a new non-patch version, please also try to # update the plugins. Plugins only work if they are compiled for the same # major/minor version. version = "0.110.0"; -in -rustPlatform.buildRustPackage { - pname = "nushell"; - inherit version; src = fetchFromGitHub { owner = "nushell"; repo = "nushell"; - tag = version; + tag = finalAttrs.version; hash = "sha256-iytTJZ70kg2Huwj/BSwDX4h9DVDTlJR2gEHAB2pGn/k="; }; @@ -61,28 +59,37 @@ rustPlatform.buildRustPackage { export NU_TEST_LOCALE_OVERRIDE="en_US.UTF-8" ''; - checkPhase = '' - runHook preCheck - ( + checkPhase = + let # The skipped tests all fail in the sandbox because in the nushell test playground, # the tmp $HOME is not set, so nu falls back to looking up the passwd dir of the build # user (/var/empty). The assertions however do respect the set $HOME. - set -x - HOME=$(mktemp -d) cargo test -j $NIX_BUILD_CORES --offline -- \ - --test-threads=$NIX_BUILD_CORES \ - --skip=repl::test_config_path::test_default_config_path \ - --skip=repl::test_config_path::test_xdg_config_bad \ - --skip=repl::test_config_path::test_xdg_config_empty ${lib.optionalString stdenv.hostPlatform.isDarwin '' - \ - --skip=plugins::config::some \ - --skip=plugins::stress_internals::test_exit_early_local_socket \ - --skip=plugins::stress_internals::test_failing_local_socket_fallback \ - --skip=plugins::stress_internals::test_local_socket - ''} - ) - runHook postCheck - ''; + skippedTests = [ + "repl::test_config_path::test_default_config_path" + "repl::test_config_path::test_xdg_config_bad" + "repl::test_config_path::test_xdg_config_empty" + ] + ++ lib.optionals stdenv.hostPlatform.isDarwin [ + "plugins::config::some" + "plugins::stress_internals::test_exit_early_local_socket" + "plugins::stress_internals::test_failing_local_socket_fallback" + "plugins::stress_internals::test_local_socket" + ]; + skippedTestsStr = lib.concatStringsSep " " (lib.map (testId: "--skip=${testId}") skippedTests); + in + '' + runHook preCheck + + cargo test -j $NIX_BUILD_CORES --offline -- \ + --test-threads=$NIX_BUILD_CORES ${skippedTestsStr} + + runHook postCheck + ''; + + nativeCheckInputs = [ + writableTmpDirAsHomeHook + ]; checkInputs = lib.optionals stdenv.hostPlatform.isDarwin [ curlMinimal ] ++ lib.optionals stdenv.hostPlatform.isLinux [ openssl ]; @@ -106,4 +113,4 @@ rustPlatform.buildRustPackage { ]; mainProgram = "nu"; }; -} +}) From d56f3107ea6ef4ab36d8440b18cf32aa8c16f84a Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 2 Feb 2026 14:42:24 +0000 Subject: [PATCH 2/3] nushell: skip failing test on darwin --- pkgs/by-name/nu/nushell/package.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/by-name/nu/nushell/package.nix b/pkgs/by-name/nu/nushell/package.nix index 43a1b5477937..044715171857 100644 --- a/pkgs/by-name/nu/nushell/package.nix +++ b/pkgs/by-name/nu/nushell/package.nix @@ -74,6 +74,9 @@ rustPlatform.buildRustPackage (finalAttrs: { "plugins::stress_internals::test_exit_early_local_socket" "plugins::stress_internals::test_failing_local_socket_fallback" "plugins::stress_internals::test_local_socket" + + # Error: × I/O error: Operation not permitted (os error 1) + "shell::environment::env::path_is_a_list_in_repl" ]; skippedTestsStr = lib.concatStringsSep " " (lib.map (testId: "--skip=${testId}") skippedTests); From 2b7b8f66a80a608eacbb2a0be75a867eb67c41a1 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Mon, 2 Feb 2026 14:48:20 +0000 Subject: [PATCH 3/3] nushell: use versionCheckHook instead of testers.testVersion --- pkgs/by-name/nu/nushell/package.nix | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/nu/nushell/package.nix b/pkgs/by-name/nu/nushell/package.nix index 044715171857..64cca8384587 100644 --- a/pkgs/by-name/nu/nushell/package.nix +++ b/pkgs/by-name/nu/nushell/package.nix @@ -13,10 +13,9 @@ libgit2, withDefaultFeatures ? true, additionalFeatures ? (p: p), - testers, - nushell, nix-update-script, curlMinimal, + versionCheckHook, writableTmpDirAsHomeHook, }: @@ -91,6 +90,7 @@ rustPlatform.buildRustPackage (finalAttrs: { ''; nativeCheckInputs = [ + versionCheckHook writableTmpDirAsHomeHook ]; checkInputs = @@ -99,9 +99,6 @@ rustPlatform.buildRustPackage (finalAttrs: { passthru = { shellPath = "/bin/nu"; - tests.version = testers.testVersion { - package = nushell; - }; updateScript = nix-update-script { }; };