gitu icon indicating copy to clipboard operation
gitu copied to clipboard

Adds Nix flake for building on NixOS

Open t56k opened this issue 11 months ago • 6 comments

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.

t56k avatar Mar 12 '24 09:03 t56k

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

Mojken avatar Mar 12 '24 09:03 Mojken

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

postsolar avatar Mar 12 '24 15:03 postsolar

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
@@           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.

codecov[bot] avatar Mar 12 '24 17:03 codecov[bot]

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!

altsem avatar Mar 12 '24 21:03 altsem

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.

t56k avatar Mar 12 '24 22:03 t56k

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

evanrichter avatar Mar 12 '24 22:03 evanrichter

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!

Mojken avatar Mar 13 '24 09:03 Mojken

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

justinrubek avatar Mar 13 '24 19:03 justinrubek

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

altsem avatar Mar 13 '24 20:03 altsem