Skip to content

Commit

Permalink
Cleanup dev setup (#36)
Browse files Browse the repository at this point in the history
* chore: nixfmt-rfc-style

* tidy: don't need old nixpkgs for ocamlformat any more

* tidy: nixpkgs rather than dev opam scope for lsp/utop

* bump: nixpkgs version for format check

* refactor(build): onix based env
  • Loading branch information
actionshrimp authored Oct 31, 2024
1 parent 5abc06a commit 7029c76
Show file tree
Hide file tree
Showing 7 changed files with 3,671 additions and 260 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- uses: cachix/install-nix-action@v26
- run: nix-shell -I nixpkgs=channel:nixos-23.05 --pure -p ocamlformat_0_22_4 dune_3 ocaml --run "dune build @fmt"
- run: nix-shell -I nixpkgs=channel:nixpkgs-unstable --pure -p ocamlformat_0_22_4 dune_3 ocaml --run "dune build @fmt"
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,8 @@ opam-install-deps:

format:
dune build @fmt --auto-promote

onix-lock:
onix lock ./gcloud.opam ./gcloud-cli.opam --resolutions="ocaml-system=5.2.0" --lock-file ./onix-lock.json
onix lock ./gcloud.opam ./gcloud-cli.opam ./gcloud-melange.opam --resolutions="ocaml-system=5.2.0" --with-dev-setup=true --with-test=true --lock-file ./onix-lock-dev.json
git add onix-lock.json onix-lock-dev.json
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,21 @@
OCaml bindings to the Google Cloud Platform APIs
================================================

## Development

The default nix devShell will have the packages needed to develop `ocaml-gcloud`:
```
nix develop '.#' # (or use nix-direnv)
dune build ...
```

### Updating opam package set

If you've updated the `.opam` files in the project and need to recalculate the `opam` deps, run `make onix-lock` and refresh the devShell:

```
# From inside the nix devShell
$ make onix-lock
$ exit # (or nix-direnv-reload if using nix-direnv)
$ nix develop '.#'
```
153 changes: 15 additions & 138 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7029c76

Please sign in to comment.