feat: devbox (#572)

This PR adds a [devbox](https://www.jetpack.io/devbox/) config to the repo.
This may be beneficial to anyone interested in nix but doesn't want to deal with the language, or anyone interested in an easy way to start development for `tea`.

With `devbox` installed, `devbox shell` should drop you into a shell with `go 1.20.x`, `gopls` (language server), and `make` for build targets available.
I didn't want to duplicate all of our Makefile, but I did add a single script `devbox run build` because it also has the packages above available, so at the very least a user with `devbox` should be able to build the project.

We don't have CGO, so nothing extra should be required that I can think of, and our linters are invoked via `go run` so they should also work since the `go` package would be available.

-----

As a quick note, I am more familiar with nix itself than I am with devbox, but I think this could potentially help anyone wanting to quickly contribute.

If you want to get really meta and are a nix user, you could even run `nix run nixpkgs#devbox shell` to drop into the shell.

Another alternative would be to write an actual flake with a devShell, however I think `devbox` is a nice in-between. Anyone comfortable with nix can probably whip up a dev environment fairly easily without `devbox`.

Co-authored-by: techknowlogick <techknowlogick@noreply.gitea.com>
Reviewed-on: https://gitea.com/gitea/tea/pulls/572
Co-authored-by: jolheiser <john.olheiser@gmail.com>
Co-committed-by: jolheiser <john.olheiser@gmail.com>
pull/583/head
jolheiser 8 months ago committed by techknowlogick
parent 9e1919ec0a
commit 66b4decdd1

@ -0,0 +1,15 @@
{
"packages": [
"go@1.20",
"gopls@latest",
"gnumake@latest"
],
"shell": {
"init_hook": [
"echo 'Welcome to tea. Check out the Makefile for runnable targets.'"
],
"scripts": {
"build": "make"
}
}
}

@ -0,0 +1,23 @@
{
"lockfile_version": "1",
"packages": {
"gnumake@latest": {
"last_modified": "2023-08-30T00:25:28Z",
"resolved": "github:NixOS/nixpkgs/a63a64b593dcf2fe05f7c5d666eb395950f36bc9#gnumake",
"source": "devbox-search",
"version": "4.4.1"
},
"go@1.20": {
"last_modified": "2023-08-30T00:25:28Z",
"resolved": "github:NixOS/nixpkgs/a63a64b593dcf2fe05f7c5d666eb395950f36bc9#go",
"source": "devbox-search",
"version": "1.20.7"
},
"gopls@latest": {
"last_modified": "2023-08-30T00:25:28Z",
"resolved": "github:NixOS/nixpkgs/a63a64b593dcf2fe05f7c5d666eb395950f36bc9#gopls",
"source": "devbox-search",
"version": "0.13.2"
}
}
}
Loading…
Cancel
Save