Skip to content
Merged
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
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -412,3 +412,22 @@ See [doc/PERF-HANDOFF.md](doc/PERF-HANDOFF.md) and [doc/BENCHMARKS.md](doc/BENCH
The historical Shen 22.4 head-to-head versus the `shen-c` 0.2.3 interpreter (same
machine) is preserved in [doc/BENCHMARKS.md](doc/BENCHMARKS.md): fib 66–79× faster, n-queens ~2.5× faster,
Einstein's riddle ~1.5× slower.
## Optional Nix environment

Nix is optional; the normal shen-lua build and launcher commands continue to work
with tools installed by any method. For a pinned development toolchain:

```sh
nix develop
```

The flake also exports `packages.toolchain` for composition by
[Bifrost](https://github.com/pyrex41/bifrost):

```sh
nix shell .#toolchain
```

If direnv is installed, `direnv allow` opts this checkout into the same dev
shell automatically. Nothing activates until that explicit authorization, and
Nix is never required at runtime.
27 changes: 27 additions & 0 deletions flake.lock

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

8 changes: 8 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
description = "shen-lua development environment";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
outputs = { nixpkgs, ... }: let systems = [ "aarch64-darwin" "x86_64-darwin" "aarch64-linux" "x86_64-linux" ]; each = f: nixpkgs.lib.genAttrs systems (system: f nixpkgs.legacyPackages.${system}); in {
packages = each (pkgs: { toolchain = pkgs.buildEnv { name = "shen-lua-toolchain"; paths = with pkgs; [ gnumake gcc luajit luarocks ]; }; default = pkgs.buildEnv { name = "shen-lua-toolchain"; paths = with pkgs; [ gnumake gcc luajit luarocks ]; }; });
devShells = each (pkgs: { default = pkgs.mkShell { packages = with pkgs; [ gnumake gcc luajit luarocks ]; }; });
};
}
Loading