Skip to content

Add a Nix flake - #1

Open
hhornbacher wants to merge 1 commit into
Jezza:mainfrom
hhornbacher:nix-flake
Open

Add a Nix flake#1
hhornbacher wants to merge 1 commit into
Jezza:mainfrom
hhornbacher:nix-flake

Conversation

@hhornbacher

Copy link
Copy Markdown

Adds a flake.nix so faff can be built, run, and installed with Nix.

  • nix run github:Jezza/faff / nix profile install github:Jezza/faff
  • nix develop gives a dev shell with the Rust toolchain plus jj and wezterm
  • The built binary is wrapped so jj and wezterm are on PATH at runtime. claude is intentionally not wrapped in — faff spawns it via wezterm cli spawn -- claude, so it resolves from your interactive shell inside the pane.
  • Builds via rustPlatform.buildRustPackage using the committed Cargo.lock; rusqlite's bundled SQLite compiles with the stdenv C compiler.
  • doCheck is off: the test suite shells out to a real jj, which isn't available in the Nix build sandbox.
  • Name and version are read from Cargo.toml.
  • README gains a short "Nix" section.

I've been running this to install faff on my NixOS laptop. Happy to adjust anything (e.g. drop the flake-utils dependency, or pin nixpkgs to a release instead of unstable) to match your preferences.

- build with rustPlatform.buildRustPackage using the vendored Cargo.lock
- wrap the binary so jj and wezterm are on PATH at runtime; claude still
  comes from the interactive session (spawned inside a wezterm pane)
- skip the jj-dependent test suite in the sandboxed build
- expose packages.default, apps.default, and a dev shell with the rust
  toolchain + jj + wezterm
- read name and version from Cargo.toml
- document nix usage in the README
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant