air-verse / air

☁️ Live reload for Go apps
GNU General Public License v3.0
16.35k stars 771 forks source link

Add nix support #519

Open acaloiaro opened 5 months ago

acaloiaro commented 5 months ago

This PR allows air to be a Flake input for Nix users who use air in their Go projects.

It also better supports air development by providing a development shell that contains all of air's developer dependencies.

I understand if this is not a priority for this project, and I'll continue maintaining my fork of air at acaloiaro/air if you choose not to directly support nix.

Cheers!

codecov[bot] commented 5 months ago

Codecov Report

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

Comparison is base (56d3d58) 69.22% compared to head (57f33b5) 69.50%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #519 +/- ## ========================================== + Coverage 69.22% 69.50% +0.27% ========================================== Files 9 9 Lines 1082 1082 ========================================== + Hits 749 752 +3 + Misses 253 251 -2 + Partials 80 79 -1 ```

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

cosmtrek commented 5 months ago

@acaloiaro Thanks! Looks great, while I need some time to learn Nix firstly :smile:

acaloiaro commented 5 months ago

@acaloiaro Thanks! Looks great, while I need some time to learn Nix firstly 😄

Sounds good @cosmtrek. I'm happy to clarify anything if you have questions.

One thing worth considering for this PR is that it serves two uses cases: users and developers.

For users it makes air available as a "flake input" for nix projects that use air. E.g. this allows Nix Flake users to delcare air as an input to their system configurations (make it globablly available), or as an input to projects, so that air is available within that project's "development shell".

For air developers who are also nix users, it allows them to simply run nix develop to get a development shell with all of air's dependencies.

I joined these two user and developer use cases into a single PR, but they could be easy considered in isolation. Selfishly, as a nix user, I want both. But it would be reasonable as a project maintainer to consider them separately.