Description
Discussed in #27316
Originally posted by nieomylnieja February 15, 2024
Tell us more.
Devbox is a tool for creating isolated dev environments built on top of nix.
It is configured with JSON, a sample config file looks like this:
{
"packages": [
"mockgen@latest",
"go@1.22",
"gotools@latest"
],
"shell": {
"init_hook": [
"export \"GOROOT=$(go env GOROOT)\""
]
}
}
The exact version of packages is stored in devbox.lock.json file:
{
"lockfile_version": "1",
"packages": {
"go@1.22": {
"last_modified": "2024-02-08T11:55:47Z",
"resolved": "github:NixOS/nixpkgs/c0b7a892fb042ede583bdaecbbdc804acb85eabe#go_1_22",
"source": "devbox-search",
"version": "1.22.0",
"systems": {
"aarch64-darwin": {
"store_path": "/nix/store/2022s0jnrn2iyxjaikfy51w5fvifp38b-go-1.22.0"
},
"aarch64-linux": {
"store_path": "/nix/store/7wxzkvjv8qc2awhagpz0r8q9ay38q3wj-go-1.22.0"
},
"x86_64-darwin": {
"store_path": "/nix/store/fgkl3qk8p5hnd07b0dhzfky3ys5gxjmq-go-1.22.0"
},
"x86_64-linux": {
"store_path": "/nix/store/88y9r33p3j8f7bc8sqiy9jdlk7yqfrlg-go-1.22.0"
}
}
},
"gotools@latest": {
"last_modified": "2024-01-27T14:55:31Z",
"resolved": "github:NixOS/nixpkgs/160b762eda6d139ac10ae081f8f78d640dd523eb#gotools",
"source": "devbox-search",
"version": "0.16.1",
"systems": {
"aarch64-darwin": {
"store_path": "/nix/store/dgh1j43hzn7w5djkl5fkb8mmg6zqcr1c-gotools-0.16.1"
},
"aarch64-linux": {
"store_path": "/nix/store/kdy76bywmdza2rca2ks3zd72bibgx7zc-gotools-0.16.1"
},
"x86_64-darwin": {
"store_path": "/nix/store/mxsvgy1bkzpj57mdc5h4y7d8gjiviv86-gotools-0.16.1"
},
"x86_64-linux": {
"store_path": "/nix/store/6y9k19pm3hyadm0zzg3bsgbrjsfgxrm1-gotools-0.16.1"
}
}
},
"mockgen@latest": {
"last_modified": "2024-01-27T14:55:31Z",
"resolved": "github:NixOS/nixpkgs/160b762eda6d139ac10ae081f8f78d640dd523eb#mockgen",
"source": "devbox-search",
"version": "0.4.0",
"systems": {
"aarch64-darwin": {
"store_path": "/nix/store/f9nlx8zjmzlhk5hdqkavjvcrpv69sxg6-mockgen-0.4.0"
},
"aarch64-linux": {
"store_path": "/nix/store/6bqnm6mhicphr1k96my93q8v8z9rwsjw-mockgen-0.4.0"
},
"x86_64-darwin": {
"store_path": "/nix/store/5azrpi395ffw1nj1nwv15sc8w0xwbg78-mockgen-0.4.0"
},
"x86_64-linux": {
"store_path": "/nix/store/9j3482y5py35g4z9gaf61qibi0gr5gfq-mockgen-0.4.0"
}
}
}
}
}
The packages are updated with devbox update
command according to constraints specified in devbox.json
, for instance go@1.22
will not be updated to Go 1.23 but to the latest 1.22 minor/patch version.
Latest will always update to the latest, major including.
Thre's an API we could use which queries https://www.nixhub.io/, example:
curl 'https://www.nixhub.io/search?q=go&_data=routes%2F_nixhub.search'
Although that would require writing custom logic around resolving the package version constraints, ideally we would simply call devbox update
, but I'm not sure If that's a possibility with Renovate --> calling external programs.
Ref: jetify-com/devbox#1175.
Activity