summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeoff Reedy <geoff@programmer-monk.net>2021-09-08 05:53:09 -0600
committerGitHub <noreply@github.com>2021-09-08 13:53:09 +0200
commit087513bc11ed548a98587a7ac6b69472e3323231 (patch)
tree0545c0ebac28f981067224ceefd353493362a7b6
parent5a65943b93b82201e94c333ed4d5a9a8b569a7d8 (diff)
mkShell: exclude inputsFrom from merged inputs (#137005)
The motivation for inputsFrom is to create a shell environment that is suitable for development of the packages listed in inputsFrom. This commit filters out any dependencies from one package in inputsFrom to another when computing the shell environment's inputs. This supports the use case where several closely related packages (perhaps even built from the same source tree) are being mutually developed. It is assumed that the user will configure their environment to resolve dependencies between these mutually developed packages.
-rw-r--r--pkgs/build-support/mkshell/default.nix5
1 files changed, 3 insertions, 2 deletions
diff --git a/pkgs/build-support/mkshell/default.nix b/pkgs/build-support/mkshell/default.nix
index 7ca4cc23c1d5..f85a11394cb5 100644
--- a/pkgs/build-support/mkshell/default.nix
+++ b/pkgs/build-support/mkshell/default.nix
@@ -14,8 +14,9 @@
, ...
}@attrs:
let
- mergeInputs = name: lib.concatLists (lib.catAttrs name
- ([ attrs ] ++ inputsFrom));
+ mergeInputs = name:
+ (attrs.${name} or []) ++
+ (lib.subtractLists inputsFrom (lib.catAttrs name inputsFrom));
rest = builtins.removeAttrs attrs [
"packages"