Open shadowrylander opened 1 year ago
That's done with imports: https://devenv.sh/composing-using-imports/
Is there no other way? I was hoping I could merge them directly from arguments passed to the function with the default devenvs
.
Can you show an example how this would work?
So I have a function which recursively merges flake outputs; I was thinking that, if the object is a devenv
, if there are a default set of packages for a particular devenv
, then a user could add a specific enterShell
for that devenv
as well:
mkOutputs = outputs: recursiveUpdateAll [
# A default `devenv'
{ devShells.x86_64-linux.python-devenv.packages = [ pkgs.x86_64-linux.python3 ]; }
outputs
];
# A user's additions;
mkOutputs { devShells.x86_64-linux.python-devenv.enterShell = "echo $PYTHONPATH; exit"; };
If you're using flakes, you can just pass them as modules.
On Tue, Feb 28, 2023, 11:37 Jeet Ray @.***> wrote:
So I have a function which recursively merges flake outputs; I was thinking that, if the object is a devenv, if there are a default set of packages for a particular devenv, then a user could add a specific enterShell for that devenv as well:
mkOutputs = outputs: recursiveUpdateAll [
A default `devenv'
{ devShells.x86_64-linux.python-devenv.packages = [ pkgs.x86_64-linux.python3 ]; } outputs
];
A user's additions;mkOutputs { devShells.x86_64-linux.python-devenv.enterShell = "echo $PYTHONPATH; exit"; };
— Reply to this email directly, view it on GitHub https://github.com/cachix/devenv/issues/439#issuecomment-1447563756, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA63AZKMI66QS3PM3MT243WZV6IFANCNFSM6AAAAAAVJ2JTVQ . You are receiving this because you commented.Message ID: @.***>
So I'd still have to account for extra modules manually, correct?
I'm not sure what manually refers to. Ideally we could work on a full example flake.nix and a short user session of what's expected to happen.
So by manually, I mean taking any devenv
settings that would have been merged from the argument set passed to the function, and adding them manually to the devenv.lib.mkShell
function's module
argument, instead of merging them along with everything else, such as regular mkShell shellHooks
or propagatedBuildInputs
, etc.
Also, sorry; second account. I can never keep track of these things... 😅
Hello!
So
mergeEnvs
can be used to merge multiple nix-shells; is any way to do something similar fordevenvs
? I tried overwriting theshellHook
for adevenv
, for example, but it didn't work. I'd like to use this feature to create a bunch of useful defaultdevenvs
, then allow users to append to them as necessary.Thank you kindly for the help!