Skip to content

add devbox-installed nix packages to NixOS build #2758

@123batman

Description

@123batman

What problem are you trying to solve?

Hi,
thanks for devbox. It is great.

It is frustrating however, to not have the devbox packages instantly available in a nixos-rebuild build-vm (nor in a custom NixOS ISO).

I would like to use devbox as my primary package manager for apps and tools. But this workflow completely breaks down because I cannot test small changes to my system config in a build-vm because redownloading all the devbox packages is prohibitively expensive time-wise. As I understand it, devbox uses nix packages under the hood. So it would be absolutely FANTASTIC to have those nix-store-paths available in the VM as well instead of redownloading them after every rebuild. It would also be nice to have them available in the ISO when I generate it from my system config but that is secondary.

What solution would you like?

So telling devbox a directory where to keep an always current "devbox-packages.nix" (with all the pinned nix packages devbox resolved and installed) generated and updated by devbox in a format that I can import in my configuration.nix would be perfect.

I can run a refresh-global in the VM to give devbox the chance to wire everything up and keep to the devbox workflow. It would also have its last devbox.json and devbox.lock available. I would be happy to just have the nix-store-paths magically available during "ensuring packages are installed"

Alternatives you've considered

If that's not possible, I would appreciate a more hacky way as well. Maybe how I can write a shell script to copy over the relevant nix files from devbox to my nixos config dir and import them myself or some brute-force nix-way of letting NixOS know about all the nix-store paths to have them available in the build or even mounting the devbox-installed nix-store-paths somehow along with the system build. (I don't know much about the internals of nix and devbox)

Any help is appreciated.

I also considered setting up a nix cache server. That would speed things up slightly but still involve a lot of useless copying. Making NixOS properly aware of the packages or at least mounting them directly is the better way.

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