altsem / gitu

A TUI Git client inspired by Magit
MIT License
1.74k stars 89 forks source link

Nix flake and/or package #54

Closed t56k closed 5 months ago

t56k commented 6 months ago

Any interest in packaging this in a Nix flake and/or package? It would make it much easier than toolchaining Rust.

altsem commented 6 months ago

Most definitely. I'm unfamiliar with Nix myself though.

t56k commented 6 months ago

I've made a flake here that builds on NixOS nicely--happy to run some tests on macOS too (and/or submit a PR).

altsem commented 6 months ago

Sweet, saw the PR, will have a look at it when I can.

I suppose I need an account somewhere to publish it? How does it work?

If anyone else into nix reads this, I'd appreciate if you had a look at the PR too :)

musjj commented 6 months ago

You just need to publish the flake.nix on the root of the repo, so no extra accounts are needed. But I think flakes are best paired with a binary cache, so that end users don't have to locally build the program.

A popular option for this is Cachix. It's free for open-source projects, but you do need to register an account. There's this tutorial on setting up a GitHub CI for it. There's also this workflow from Helix for reference. For the workflow to work, you need to store the CACHIX_AUTH_TOKEN secret you get after registering your project on Cachix.

I could make a separate PR for it, if it can't just be added to the one above. But really, you can just copy-paste Helix's workflow above and %s/helix/gitu (or the name you registered on Cachix).

altsem commented 6 months ago

@musjj thanks for the input, I'll give it a shot when this is merged

evanrichter commented 6 months ago

I already started maintaining the upstream package in nixpkgs

a flake could still be useful for local development however

evanrichter commented 6 months ago

I guess another advantage of flakes is less delay between commit to package available

altsem commented 6 months ago

Nice! I take it the caching is less of an issue when developing locally

t56k commented 6 months ago

Nice! I take it the caching is less of an issue when developing locally

The flake will cache dependencies locally--and build from master on update instead of waiting for nixpkgs. Both have their advantages.

Keep in mind that my flake hasn't been tested on macOS yet, aiming to get that done shortly--unless someone just wants to run some tests and/or probably just add darwin.apple_sdk.frameworks.Security to the darwin-only buildInputs.

t56k commented 6 months ago

Nice! I take it the caching is less of an issue when developing locally

The flake will cache dependencies locally--and build from master on update instead of waiting for nixpkgs. Both have their advantages.

Keep in mind that my flake hasn't been tested on macOS yet, aiming to get that done shortly--unless someone just wants to run some tests and/or probably just add darwin.apple_sdk.frameworks.Security to the darwin-only buildInputs.

Updated with Security and libiconv to build on macOS.