Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,6 @@ compile_flags.txt

# Local .envrc overrides
.envrc.local

# nix-direnv artifacts
.direnv/
14 changes: 12 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ If you encounter any issues when following along with this file please don't hes
- [**Doxygen**](https://www.doxygen.nl): For building the C-Reference documentation pages.


##### For Linux
#### For Linux
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While not directly related I noticed that this and the following headline included one # too many.


Before installing the dependencies, you need to add the LLVM repository and GPG key to get Clang 21:

Expand All @@ -40,7 +40,7 @@ or:
sudo apt-get install check clang-21 clang-tidy-21 clang-format-21 emscripten doxygen
```

##### For macOS (using Homebrew)
#### For macOS (using Homebrew)

```bash
brew bundle
Expand All @@ -51,6 +51,16 @@ or:
brew install check llvm@21 emscripten doxygen
```

#### Nix flake

Additionally we provide a `flake.nix` file which includes all dependencies and configuration to easily get started with Herb development. The recommended way to use it is by adding something like the following to `.envrc.local`:

```sh
use flake . --no-write-lock-file
```

If you'd prefer to have a `flake.lock` use `use flake` instead and ignore the lockfile by adding it to `.git/info/exclude`.

### Building

#### Clone the Repo
Expand Down
68 changes: 68 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
description = "Herb";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};

outputs =
{
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
in
{
devShells.default = pkgs.mkShell {
packages = with pkgs; [
# JavaScript/TypeScript
nodejs_22
yarn

# Ruby
ruby_4_0
bundler

# Rust
rustc
cargo
clippy
rustfmt

# Java (JNI bindings)
jdk17

# C/C++ toolchain
llvmPackages_21.clang
llvmPackages_21.clang-tools # clang-format, clang-tidy

# C testing
check

# WebAssembly
emscripten

# Documentation
doxygen

# Build tools and libraries
gnumake
libyaml
nodePackages."yarn"
];

shellHook = ''
export cc=clang
export clang_format=clang-format
export clang_tidy=clang-tidy
export check_prefix=${pkgs.check}
'';
};
}
);
}
Loading