Skip to content
/ devbox Public

Developer boxes (containers) for development and automated builds (prototyping or testing phase!)

Notifications You must be signed in to change notification settings

rse-ops/devbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Nix DevBox

This is an experiment to use Nix packages and possibly devbox to provide working environments and containers! We will be using the standard set linked above, along with the Nix User Repository "NUR" at rseops, shown also in the community listing here.

I like this approach because I think it's the best of both worlds - easy binaries with nix, but provided in containers so I don't need to worry about dumping them all onto my local hard drive!

How does it work?

Each diretory here has a shell.nix that defines a Nix environment. We build every environment against every base container (e.g., one vanilla, and one for VSCode) in bases using uptodate. That's it!

Environments

Usage

Each environment (subfolder here that isn't bases) is built against each base. The below describes each of the bases, along with a local Devbox environment (not represented as a base).

Most of these containers will be pre-built and you can pull them down. Browse the packages alongside the repository here to see what is available! You an also browse our web interface at https://rse-ops.github.io/devbox.

Vanilla

For these containers, they are installed to a nix-os to nix-env, so you should be able to shell inside and find executables on the path.

VScode

These containers are optimized for use in VSCode. You can add a .devcontainers directory as follows:

.devcontainer/
    devcontaine.json
    Dockerfile

Where the devcontainer.json can minimally have:

{
    "name": "Development environments on your infrastructure",
    "context": "../",
    "dockerFile": "Dockerfile",
}

And the Dockerfile can use one of the images as FROM and add more packages or otherwise update the base, and then when the container starts you run nix-shell to get into your enviornment.

Devbox

Devbox is a local development environment you can also use for any container here! Once you shell into the container, you can either add to your Devbox, or shell inside:

$ devbox add <package>
$ devbox shell

And you can also use it locally with a devbox.json! To do this, you can install devbox. You will also need to install Nix. Further instructions for interaction are below.

Running Environment

Choose an environment subdirectory, e.g.,

$ cd openmpi
$ devbox shell

And that's it! Everything in the environment will be on your path.

Adding to an environment

You can browse for nix packages and then just do:

$ devbox add <package>

And then shell.

Creating an Environment

To create a new environment, create your directory, and then:

$ cd <mypackage>
$ devbox init
$ devbox add <package URI>

And please add a README.md with some basic instructions or descriptions! You are encouraged to add an uptodate.yaml that will build over a matrix of versions, and the automation will discover it.

About

Developer boxes (containers) for development and automated builds (prototyping or testing phase!)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages