From cbd803c76bd1df4aedef30bcbb82e83818282a67 Mon Sep 17 00:00:00 2001 From: Danila Danko Date: Thu, 18 Apr 2024 13:51:19 +0300 Subject: [PATCH 1/2] fix(modules > devshell): filter out non-derivation dependencies --- modules/devshell.nix | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/devshell.nix b/modules/devshell.nix index 7da291d..d70f379 100644 --- a/modules/devshell.nix +++ b/modules/devshell.nix @@ -216,10 +216,11 @@ let # Returns a list of all the input derivation ... for a derivation. inputsOf = drv: - (drv.buildInputs or [ ]) ++ - (drv.nativeBuildInputs or [ ]) ++ - (drv.propagatedBuildInputs or [ ]) ++ - (drv.propagatedNativeBuildInputs or [ ]) + filter lib.isDerivation + ((drv.buildInputs or [ ]) ++ + (drv.nativeBuildInputs or [ ]) ++ + (drv.propagatedBuildInputs or [ ]) ++ + (drv.propagatedNativeBuildInputs or [ ])) ; in From 6dee0dd58da5054b9c403a47b14ba87b7966f2f9 Mon Sep 17 00:00:00 2001 From: Danila Danko Date: Thu, 18 Apr 2024 13:52:12 +0300 Subject: [PATCH 2/2] feat(tests): test packagesFrom with a null in buildInputs --- tests/core/devshell.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/core/devshell.nix b/tests/core/devshell.nix index 4756253..67e352c 100644 --- a/tests/core/devshell.nix +++ b/tests/core/devshell.nix @@ -6,6 +6,9 @@ shell = devshell.mkShell { devshell.name = "devshell-1"; devshell.packages = [ pkgs.git ]; + devshell.packagesFrom = [ + (pkgs.hello.overrideAttrs { buildInputs = [ null pkgs.cowsay ]; }) + ]; }; in runTest "devshell-1" { } '' @@ -20,6 +23,9 @@ # Adds packages to the PATH type -p git + + # Adds packages from packagesFrom to the PATH + type -p cowsay ''; # Only load profiles