Skip to content

Add Nix flake for development and build/run support#190

Merged
agavra merged 1 commit intoagavra:mainfrom
ysndr:push-xwvllskzozlu
Feb 27, 2026
Merged

Add Nix flake for development and build/run support#190
agavra merged 1 commit intoagavra:mainfrom
ysndr:push-xwvllskzozlu

Conversation

@ysndr
Copy link
Copy Markdown
Contributor

@ysndr ysndr commented Feb 26, 2026

Adds a nix flake so that nix users can build and run tuicr with

nix build github:agavra/tuicr

# or

nix run github:agavra/tuicr 

respectively.

@agavra
Copy link
Copy Markdown
Owner

agavra commented Feb 26, 2026

I'm not familiar with nix flakes, cc @krisajenkins (I remember mentioning you had done something like this) or @YPares are either of you able to review this? Is this something that needs to be checked into this repo or is there another canonical way to register nix flakes?

@YPares
Copy link
Copy Markdown
Collaborator

YPares commented Feb 26, 2026

@agavra It doesn't need to, but it can be useful to have it locally (the point of Nix flakes is that any git repo can be its own "package registry"), as long as it can be properly maintained.

That being said:

@ysndr Note that tuicr is already flake-packaged in https://github.com/numtide/llm-agents.nix:

nix run github:numtide/llm-agents.nix#tuicr

(and I've been using it as a devshell to work on tuicr too)

The advantages is that it is automatically updated everyday by the llm-agents.nix CI, and that the builds are cached publicly ( https://github.com/numtide/llm-agents.nix?tab=readme-ov-file#binary-cache ).

@ysndr
Copy link
Copy Markdown
Contributor Author

ysndr commented Feb 26, 2026

Thanks @YPares for filling the picture.
Also I wasn't aware it's in numtide's flake. I couldn't find this project on nixpkgs and building it was straight forward enough.

Good thinking on the cache part though.

The way I see it if this project wants to encourage nix users, these are the options:

  • add instructions to use numtides flake
  • upstream into nixpkgs, and add instructions
  • add a local flake and instructions (this pr)

Any combination of these (or none of them) are a valid choice.
Personally I'd appreciate a local flake for dev purposes and discorevability. Up to you @agavra if you think that's interesting at all -- remains totally optional as you can see.


That said, if you want to go forward with this PR I'd need to drop the result link and add result to the .gitignore

@agavra
Copy link
Copy Markdown
Owner

agavra commented Feb 26, 2026

👍 let's add instructions to use numtides flake but we can also keep the local flake as well. Thanks for chiming in @YPares

@YPares
Copy link
Copy Markdown
Collaborator

YPares commented Feb 26, 2026

Ok :)
The only thing in the PR I'm not up to speed with is naersk, which I haven't used myself. What advantages does it bring compared to the usual rustPlatform of nixpkgs?

@ysndr
Copy link
Copy Markdown
Contributor Author

ysndr commented Feb 27, 2026

naersk

The main benefits are

  • And dependency parsing without IFD (import from derivation) or FOD which should make maintainance easier as the package wont need updates together with cargo deps.
  • it's dependency caching, i.e. building crate dependencies first, requiring only rebuilds of the root crate. This speeds up repeat builds (esp when combined with CI, but thats deeper than this PR intends)

It fairly common alternative, along with crates2nix (better caching more overhead for cargo dep changes).

If you prefer vanilla nixpkgs I can throw naersk out as well.

@YPares
Copy link
Copy Markdown
Collaborator

YPares commented Feb 27, 2026

@ysndr No it looks simple enough :) thanks for the answer!

@agavra agavra merged commit 5143a5e into agavra:main Feb 27, 2026
4 checks passed
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.

3 participants