Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add inputsFrom option/function to Shells #809

Open
DrRuhe opened this issue Sep 3, 2023 · 0 comments · May be fixed by #861
Open

Add inputsFrom option/function to Shells #809

DrRuhe opened this issue Sep 3, 2023 · 0 comments · May be fixed by #861
Labels
enhancement New feature or request

Comments

@DrRuhe
Copy link

DrRuhe commented Sep 3, 2023

Hi,

nixpkgs.lib.mkShell has the ability to get all inputs from a list of derivations. This is useful to not require respecification of dependencies.

I tried adapting the code from nixpkgs.lib.mkShell and got this function:

inputs-from = inputsFrom: builtins.concatMap (inputKind: (pkgs.lib.subtractLists inputsFrom (pkgs.lib.flatten (pkgs.lib.catAttrs inputKind inputsFrom)))) ["buildInputs" "nativeBuildInputs" "propagatedBuildInputs" "propagatedNativeBuildInputs"];

However it still does not work properly, so I'm putting this here in the hope that

  • devenv gains this functionality by default (either by exposing a function or directly as an option for shells)
  • someone notices what I did wrong

For more details on the error I am seeing:
I have a flake using flake.parts with this devenv section:

devenv.shells.default = {
          packages =
            [
               # rust toolchain and some other tools
            ]   
            ++ inputs-from (builtins.attrValues self'.checks);
        };

Which results in linker errors that cc is not found, so I'm assuming the function I wrote is faulty.
The Original version using nixpkgs.lib.mkShell worked fine:

devShells.default = pkgs.mkShell {
          inputsFrom = builtins.attrValues self'.checks;

          nativeBuildInputs =
            [
               # rust toolchain and some other tools
            ];    
        };
@DrRuhe DrRuhe added the enhancement New feature or request label Sep 3, 2023
@BurNiinTRee BurNiinTRee linked a pull request Nov 3, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant