Skip to content

How to combine shells #311

@zmrocze

Description

@zmrocze

Hey,

how would i go about combining shells? I tried the below but it doesn't work, why? Should I use modules?

For example I'd like to do:

devshells = {
  default = {
    devshell = {
      name = "My main shell";
      packagesFrom = [
        config.devShells.haskell
        config.devShells.utils
      ];
    };
  };
  utils = {
    devshell.name = "My subproject shell";
    commands = [
      {
        name = "my-util";
        command = "${pkgs.utils}/bin/my-util";
      }
    ];
  };
}    

defining an utils shell with the devshell module and combining it with a classical derivation based shell config.devShells.haskell that for example is created by some library code and I don't define it by myself.
Or combine two or more shells of whatever flavor together, best getting information about conflicts.

In the example above, the resulting default shell indeed has all the commands coming from the haskell shell, but the my-util commad is missing from it. Why?

Given that devshells use module system, it's possible to share devshells by sharing modules. BUT I would like to understand why the above doesn't include my-utils inside shell? Together with #310 where I ask about the packages argument.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions