Skip to content

devbox generate nix #2655

@acuteaura

Description

@acuteaura

What problem are you trying to solve?

We're in a situation where we've bundled some scripts with a writeShellScriptBin wrapper + devbox binary into a nix derivation outside devbox to replace syncing files using our existing nix install in CI (and for local testing). This creates a hen/egg sort of problem, where we embed devbox.json/devbox.lock into this derivation (so we can't install that derivation via flake support in devbox), write it to the current directory, ask the user to enter a devbox shell (because we need version selection for those packages, and preferably without needing to know nix) and then rely on the devbox environment to run scripts provided by our derivation.

What solution would you like?

A devbox command that exports a devbox.json+lock into an overlay, so we can build one derivation instead of two.

Alternatives you've considered

We could just maintain this overlay ourselves (with a little help from NixHub), but since devbox has the entire context and extra features (closure fetching, specifying outputs) already in place (just rendering into mkShell instead of an overlay) it would be nice to keep the same semantics and workflow for updating/maintaining a devbox.json.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or requesttriageIssue needs triage

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions