altsem / gitu

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

Adds Nix flake for building on NixOS #56

Closed t56k closed 5 months ago

t56k commented 6 months ago

Closes #54 (ignoring macOS for the time being--my Nix install in that env is borked). Might need some extra buildInputs for macOS/Darwin, happy to amend when I can.

Mojken commented 6 months ago

Nice work! Please update the readme with install instructions as well :)

postsolar commented 6 months ago

Just for my own learning, why is crane needed given that you can just give rustPlatform.buildRustPackage the local lockfile?

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 83.03%. Comparing base (7c0f628) to head (14da72b).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #56 +/- ## ======================================= Coverage 83.03% 83.03% ======================================= Files 32 32 Lines 2564 2564 ======================================= Hits 2129 2129 Misses 435 435 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

altsem commented 6 months ago

I'll leave this here just for a day or two to gather input, as I'm not adept with nix myself. A mention in the README would be nice!

t56k commented 6 months ago

Just for my own learning, why is crane needed given that you can just give rustPlatform.buildRustPackage the local lockfile?

Crane is a relatively-simplified way of making a temporary Rust environment on Nix platforms with platform-specific requirements, checks, and the like, so that gitu's builds are (more) reproducible. Helix's example shows a more comprehensive use-case. In my experience it just makes building easier, but if there's enough pushback I'm happy to change it. Also it's what I've used in the past and what has worked for my devops deployments.

evanrichter commented 6 months ago

gitu is already packaged in the official nixpkgs repo: https://github.com/NixOS/nixpkgs/blob/ddbd484a31481757a93d1ce7122dcb8469ff5fb2/pkgs/by-name/gi/gitu/package.nix

this will provide a binary cache, and it works on both macOS and linux

this flake does provide a devShell, which would be useful for local development if maintainers want to lock their development dependencies

Mojken commented 6 months ago

gitu is already packaged in the official nixpkgs repo: https://github.com/NixOS/nixpkgs/blob/ddbd484a31481757a93d1ce7122dcb8469ff5fb2/pkgs/by-name/gi/gitu/package.nix

Oh, I swear I searched and couldn't find it, but when I look now it's right there. Cheers!

justinrubek commented 5 months ago

Feel free to tag me in on any nix-related stuff in the future if needed, particularly if it would otherwise go unmaintained

altsem commented 5 months ago

Amazing! I'll merge this. :+1: