Skip to content

mkDerivation: add toDevShell passthru (EEP 0001) - #155

Open
jonringer wants to merge 3 commits into
masterfrom
dev-shell
Open

jonringer wants to merge 3 commits into
masterfrom
dev-shell

Conversation

@jonringer

Copy link
Copy Markdown
Collaborator

Expose a toDevShell function on every mkDerivation output that converts the derivation into a development shell, preserving its build environment (compiler, flags, phases, environment variables). Accepts either an attrset or a function (stdenv -> attrset) for conditional inputs.

See: ekala-project/eeps#1

Expose a toDevShell function on every mkDerivation output that converts
the derivation into a development shell, preserving its build environment
(compiler, flags, phases, environment variables). Accepts either an
attrset or a function (stdenv -> attrset) for conditional inputs.

See: ekala-project/eeps#1
Rewire toDevShell passthru so that drv.toDevShell {} calls mkDevShell
under the hood, giving every derivation access to ekaos service modules,
language modules, and process-compose integration in its dev shell.

mkDevShell gains nativeBuildInputs, propagatedBuildInputs,
propagatedNativeBuildInputs, inputsFrom, env, and name parameters so it
can receive the full build environment from toDevShell.

to-dev-shell.nix now produces a mkDevShell-compatible attrset, merging
the original derivation's dependencies and extracting env vars while
filtering out phase hooks and build infrastructure attrs.

mkDevShell is injected lazily into config so make-derivation.nix can
reference it without circular evaluation.
Comment thread default.nix
Comment on lines +148 to +153
configEval.config
// {
# Injected lazily for toDevShell passthru — only forced when a user
# actually calls drv.toDevShell, at which point pkgs is fully resolved.
mkDevShell = pkgs.mkDevShell;
};

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not a fan of this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant