1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-15 06:52:43 +01:00

Merge pull request #14489 from roberth/shell-a-la-carte

Infer devShell deps, provide smaller one
This commit is contained in:
John Ericson 2025-11-11 16:17:05 +00:00 committed by GitHub
commit 918c1a9e58
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 264 additions and 90 deletions

View file

@ -2,7 +2,16 @@
lib,
stdenv,
mkMesonDerivation,
buildPackages,
meson,
ninja,
pkg-config,
jq,
git,
mercurial,
unixtools,
util-linux,
nix-store,
nix-expr,
@ -37,17 +46,20 @@ mkMesonDerivation (
./.
];
# Hack for sake of the dev shell. Need to "manually splice" since
# this isn't a specially-recognized list of dependencies.
passthru.externalNativeBuildInputs = [
buildPackages.meson
buildPackages.ninja
buildPackages.pkg-config
nativeBuildInputs = [
meson
ninja
pkg-config
buildPackages.jq
buildPackages.git
buildPackages.mercurial
buildPackages.unixtools.script
jq
git
mercurial
unixtools.script
# Explicitly splice the hostHost variant to fix LLVM tests. The nix-cli
# has to be in PATH, but must come from the host context where it's built
# with libc++.
(nix-cli.__spliced.hostHost or nix-cli)
]
++ lib.optionals stdenv.hostPlatform.isLinux [
# For various sandboxing tests that needs a statically-linked shell,
@ -56,14 +68,7 @@ mkMesonDerivation (
# For Overlay FS tests need `mount`, `umount`, and `unshare`.
# For `script` command (ensuring a TTY)
# TODO use `unixtools` to be precise over which executables instead?
buildPackages.util-linux
];
nativeBuildInputs = finalAttrs.passthru.externalNativeBuildInputs ++ [
# Explicitly splice the hostHost variant to fix LLVM tests. The nix-cli
# has to be in PATH, but must come from the host context where it's built
# with libc++.
(nix-cli.__spliced.hostHost or nix-cli)
util-linux
];
buildInputs = [