github jetify-com/devbox 0.1.1
0.1.1 - Run Scripts, pin Nixpkg SHA

latest releases: 0.10.7-dev, 0.10.6, 0.10.6-dev...
17 months ago

Release 0.1.1 includes two major new features: package pinning and executing scripts with devbox run

New Features

Pin Nixpkgs in your Devbox.json

You can now pin an exact version of the Nixpkg repository for installing packages. This feature is useful for pinning the versions of the packages installed by Devbox, or for selecting packages from older revisions of Nixpkg.

To pin the Nixpkg version, add the commit of the Nixpkg repo that you want to use in your devbox.json.

"nixpkgs": {
    "commit": "89f196fe781c53cb50fef61d3063fa5e8d61b6e5"
}

If you leave the commit unset, Devbox will automatically add a default Nixpkg commit to your devbox.json when you run a command that reads your devbox.json like devbox add. You can update your project to the latest default by deleting the commit hash from your devbox.json.

For more details, see the Nixpkg pinning guide on our docs page.

Running Scripts in Devbox Shell

Developers can now define scripts in their devbox.json, and execute them in their Devbox Shell using devbox run. Scripts are defined by providing a name, and a command or list of commands for Devbox to run.

"shell": {
        "init_hook": [
            "source conf/set-environmen.sh",
            "rustup default stable",
            "cargo fetch"
        ],
        "scripts": {
            "test": "cargo test -- --show-output",
            "start" : "cargo run",
        }
    }

You can then execute your scripts using devbox run <script_name>. Devbox will then start an interactive shell, run your init_hook, run the script, and then exit when the script completes or is interrupted by CTRL-C. For example:

$ devbox run start

Installing nix packages. This may take a while... done.
Starting a devbox shell...
project dir is /Users/johnlago/src/devbox-examples/development/rust/rust-stable-hello-world/conf
info: using existing install for 'stable-aarch64-apple-darwin'
info: default toolchain set to 'stable-aarch64-apple-darwin'

  stable-aarch64-apple-darwin unchanged - rustc 1.64.0 (a55dd71d5 2022-09-19)

    Finished dev [unoptimized + debuginfo] target(s) in 0.00s
    Running `target/debug/rust-stable-hello-world`

Hello, world!

$

For more information and tips on how to use Devbox scripts, see the scripts guide in our docs page.

Bug Fixes

  • Fixed a bug where not all zsh startup files were included in a developer's shellrc (#250)
  • Fixed a PkgExists panic for some missing packages (#249)

What's Changed

  • nix: fix PkgExists panic for some missing packages by @gcurtis in #249
  • [feature-flag] Add simple feature flag package by @mikeland86 in #251
  • [devbox shell] ensure all zsh startup files are linked to ZDOTDIR by @savil in #250
  • [nipkgs version] add feature flag and write to devbox.json if missing by @savil in #252
  • [pkgcfg] Create new pkgckg that can load local config by @mikeland86 in #253
  • [nixpkgs version] change field from version to commit; add validation by @savil in #256
  • [nixpkgs version] generate nix files containing the nixpkgs version from config by @savil in #258
  • [nixpkgs version] devbox init should add default nixpkgs commit by @savil in #259
  • [pkg-config] Add bin sym links and add to path by @mikeland86 in #257
  • [feature flag] respect env-var of feature flag (even if turned off) and default enable Nixpkg Version FF by @savil in #266
  • [pkg-config] Implement basic mariadb config by @mikeland86 in #263
  • [pkg-config] Read config from github by @mikeland86 in #264
  • Use for logo light/dark mode by @gcurtis in #260
  • ci: suffix Jetpack preview namespaces with "-ref" by @gcurtis in #271
  • First pass at devbox scripts implementation by @ipince in #254
  • devbox: add PackageStore and Package for querying /nix/store by @gcurtis in #270
  • Docs for Devbox Run and Setting the Commit Sha by @Lagoja in #268
  • vscode extension settings + devcontainer setup + devbox commands by @mohsenari in #262
  • Unhide devbox run by @ipince in #275

Full Changelog: 0.1.0...0.1.1

Don't miss a new devbox release

NewReleases is sending notifications on new releases.