Use coreutils from nixpkgs rather than from PATH

Before this change, combinators that call `add-runtime` were assuming
coreutils were available, however `add-runtime` did not inject coreutils
as a runtime input.

This also removes forwarding $PATH in the tests which should catch any
issues like this in the future.

Thanks Epsylon for the report:
https://lists.sr.ht/~alexdavid/general/%3C331f3203-d6bf-4c53-824c-4d05088ec47e@gmail.com%3E
This commit is contained in:
Alex David 2025-10-03 10:48:23 -07:00
commit 61b0a147af
2 changed files with 7 additions and 2 deletions

View file

@ -103,7 +103,13 @@ let
if builtins.length state.cleanup > 0 then "" else "exec " if builtins.length state.cleanup > 0 then "" else "exec "
}${state.cmd} "''${RUNTIME_ARGS[@]}" -- ${state.entry} ${state.argv} }${state.cmd} "''${RUNTIME_ARGS[@]}" -- ${state.entry} ${state.argv}
'') '')
(text: pkgs.writeShellApplication { inherit name text; }) (
text:
pkgs.writeShellApplication {
inherit name text;
runtimeInputs = [ pkgs.coreutils ];
}
)
# forward man pages # forward man pages
(jailed: if exe ? man then jailed // { inherit (exe) man; } else jailed) (jailed: if exe ? man then jailed // { inherit (exe) man; } else jailed)

View file

@ -73,7 +73,6 @@ inTestM = aroundWith $ \action () -> do
(\(name, getVal) -> ((name,) <$>) <$> getVal) (\(name, getVal) -> ((name,) <$>) <$> getVal)
[ ("HOME", lookupEnv "HOME"), [ ("HOME", lookupEnv "HOME"),
("LANG", pure $ Just "en_US.UTF-8"), ("LANG", pure $ Just "en_US.UTF-8"),
("PATH", lookupEnv "PATH"),
("DBUS_SESSION_BUS_ADDRESS", lookupEnv "DBUS_SESSION_BUS_ADDRESS"), ("DBUS_SESSION_BUS_ADDRESS", lookupEnv "DBUS_SESSION_BUS_ADDRESS"),
("XDG_RUNTIME_DIR", lookupEnv "XDG_RUNTIME_DIR") ("XDG_RUNTIME_DIR", lookupEnv "XDG_RUNTIME_DIR")
] ]