From 693927196a3f46d40272d473efabf9d08e3221a0 Mon Sep 17 00:00:00 2001 From: Michael Daniels Date: Thu, 25 Dec 2025 17:10:45 -0500 Subject: [PATCH] versionCheckHook: use coreutils env I was getting an "env: unrecognized option '--argv0=less'" error when using a package that used this hook in the bootstrap sequence. --- pkgs/by-name/ve/versionCheckHook/hook.sh | 2 +- pkgs/by-name/ve/versionCheckHook/package.nix | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/ve/versionCheckHook/hook.sh b/pkgs/by-name/ve/versionCheckHook/hook.sh index 4a977fe7a888c..dc902ae32faa8 100644 --- a/pkgs/by-name/ve/versionCheckHook/hook.sh +++ b/pkgs/by-name/ve/versionCheckHook/hook.sh @@ -10,7 +10,7 @@ _handleCmdOutput(){ done fi - versionOutput="$(env \ + versionOutput="$(@envCommand@ \ --chdir=/ \ --argv0="$(basename "${command[0]}")" \ "${envArgs[@]}" \ diff --git a/pkgs/by-name/ve/versionCheckHook/package.nix b/pkgs/by-name/ve/versionCheckHook/package.nix index d5039db3f219a..0cf103133e04b 100644 --- a/pkgs/by-name/ve/versionCheckHook/package.nix +++ b/pkgs/by-name/ve/versionCheckHook/package.nix @@ -1,12 +1,14 @@ { lib, makeSetupHook, + coreutils, }: makeSetupHook { name = "version-check-hook"; substitutions = { storeDir = builtins.storeDir; + envCommand = lib.getExe' coreutils "env"; # Cannot call it env, because it isn't an attrset of environment variables! }; meta = { description = "Lookup for $version in the output of --help and --version";