this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add nix flake dev shell covering rust + elixir + ts monorepo

Pins the full toolchain per-project rather than relying on globally
installed rust/elixir/node. Direnv picks it up via '.envrc' on cd, and
'.gitignore' now excludes the '.direnv/' cache and 'result' symlinks
from 'nix build'.

Included:
* Rust stable + wasm32 target (for crates/opake-wasm), rust-analyzer,
clippy, rustfmt, plus wasm-pack and cargo-edit/watch/nextest.
* Elixir 1.18 on OTP 27 for apps/indexer (Phoenix 1.8).
* postgresql_17 client, matching docker-compose.development.yaml's
postgres:17-alpine image.
* nodejs_24 + bun for the TS monorepo.
* just for the justfile.

+136
+2
.envrc
··· 1 + use flake 2 + 1 3 # Frontend URL for CLI OAuth callback redirect 2 4 # Production: https://opake.app/devices/cli-callback 3 5 export OPAKE_FRONTEND_URL=http://localhost:5173
+5
.gitignore
··· 61 61 .claude/settings.local.json 62 62 .claude/hooks/node_modules/ 63 63 .claude/worktrees 64 + 65 + # nix / direnv 66 + .direnv/ 67 + /result 68 + /result-*
+48
flake.lock
··· 1 + { 2 + "nodes": { 3 + "nixpkgs": { 4 + "locked": { 5 + "lastModified": 1776548001, 6 + "narHash": "sha256-ZSK0NL4a1BwVbbTBoSnWgbJy9HeZFXLYQizjb2DPF24=", 7 + "owner": "NixOS", 8 + "repo": "nixpkgs", 9 + "rev": "b12141ef619e0a9c1c84dc8c684040326f27cdcc", 10 + "type": "github" 11 + }, 12 + "original": { 13 + "owner": "NixOS", 14 + "ref": "nixos-unstable", 15 + "repo": "nixpkgs", 16 + "type": "github" 17 + } 18 + }, 19 + "root": { 20 + "inputs": { 21 + "nixpkgs": "nixpkgs", 22 + "rust-overlay": "rust-overlay" 23 + } 24 + }, 25 + "rust-overlay": { 26 + "inputs": { 27 + "nixpkgs": [ 28 + "nixpkgs" 29 + ] 30 + }, 31 + "locked": { 32 + "lastModified": 1776741231, 33 + "narHash": "sha256-k9G98qzn+7npROUaks8VqCFm7cFtEG8ulQLBBo5lItg=", 34 + "owner": "oxalica", 35 + "repo": "rust-overlay", 36 + "rev": "02061303f7c4c964f7b4584dabd9e985b4cd442b", 37 + "type": "github" 38 + }, 39 + "original": { 40 + "owner": "oxalica", 41 + "repo": "rust-overlay", 42 + "type": "github" 43 + } 44 + } 45 + }, 46 + "root": "root", 47 + "version": 7 48 + }
+81
flake.nix
··· 1 + { 2 + description = "opake dev shell — Rust + TS monorepo with wasm bindings"; 3 + 4 + inputs = { 5 + nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; 6 + 7 + # per-project rust toolchain via oxalica's overlay; keeps stable/ 8 + # nightly/targets composable without rustup. 9 + rust-overlay = { 10 + url = "github:oxalica/rust-overlay"; 11 + inputs.nixpkgs.follows = "nixpkgs"; 12 + }; 13 + }; 14 + 15 + outputs = { self, nixpkgs, rust-overlay, ... }: 16 + let 17 + systems = [ "aarch64-darwin" "aarch64-linux" "x86_64-darwin" "x86_64-linux" ]; 18 + forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f (import nixpkgs { 19 + inherit system; 20 + overlays = [ rust-overlay.overlays.default ]; 21 + })); 22 + in 23 + { 24 + devShells = forAllSystems (pkgs: { 25 + default = pkgs.mkShell { 26 + packages = with pkgs; [ 27 + # ── rust toolchain ─────────────────────────────────────── 28 + # stable + wasm target for crates/opake-wasm. rust-src and 29 + # rust-analyzer extensions give IDE-grade tooling. 30 + (rust-bin.stable.latest.default.override { 31 + targets = [ "wasm32-unknown-unknown" ]; 32 + extensions = [ "rust-src" "rust-analyzer" "clippy" "rustfmt" ]; 33 + }) 34 + 35 + # wasm-pack drives the opake-wasm build pipeline. It pulls 36 + # in wasm-bindgen-cli at a version matching the crate's 37 + # wasm-bindgen dep, so we don't pin wasm-bindgen-cli here 38 + # (nixpkgs' pin frequently drifts from per-project lockfiles). 39 + wasm-pack 40 + 41 + # cargo meta-tools — live here (alongside the toolchain) 42 + # rather than globally in home/tools.nix, so they always 43 + # have a matching cargo on PATH. 44 + cargo-edit # cargo add / cargo upgrade 45 + cargo-watch # auto-rebuild on file change 46 + cargo-nextest # faster test runner 47 + 48 + # ── elixir / phoenix (apps/indexer) ────────────────────── 49 + # mix.exs pins `elixir ~> 1.15`; 1.18 on OTP 27 is current 50 + # stable and satisfies that. The beam.packages form locks 51 + # the elixir↔OTP pair explicitly (vs pkgs.elixir_1_18 which 52 + # picks whatever default OTP nixpkgs ships). 53 + beam.packages.erlang_27.elixir_1_18 54 + 55 + # postgres client + libpq — the indexer talks to the 56 + # dockerized postgres:17 from docker-compose.development.yaml 57 + # via postgrex (pure-elixir driver), but psql / pg_dump are 58 + # useful for mix ecto commands and ad-hoc db poking. 59 + postgresql_17 60 + 61 + # ── ts monorepo ────────────────────────────────────────── 62 + # package.json#volta pins 24.15.0; nodejs_24 tracks the 63 + # latest 24.x, which is close enough for bun's needs. 64 + nodejs_24 65 + bun 66 + 67 + # ── task runner ────────────────────────────────────────── 68 + just 69 + ] ++ nixpkgs.lib.optionals pkgs.stdenv.isLinux [ 70 + # Phoenix LiveReload uses inotify on Linux; macOS uses 71 + # fsevents natively and doesn't need this. 72 + inotify-tools 73 + ]; 74 + 75 + shellHook = '' 76 + echo "opake dev shell — $(rustc --version | cut -d' ' -f1,2), elixir $(elixir --version 2>&1 | tail -n1 | cut -d' ' -f2), node $(node --version), bun $(bun --version)" 77 + ''; 78 + }; 79 + }); 80 + }; 81 + }