Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git: ignore nix env folders #59

Merged
merged 1 commit into from
Nov 21, 2024
Merged

Conversation

Pablito2020
Copy link
Contributor

While working on another pull request, I found it frustrating that Git was tracking the .direnv and result/ folders (where Nix saves the program's closure).

This pull request adds these folders to the .gitignore to prevent them from being tracked.

@maximbaz
Copy link
Owner

Thanks for the PR! While I'm also using Nix, I think it's a bit opportunistic for us to expect that every single project in the world should git-ignore all particulates of every single operating system and environment 🙃 Have you considered putting those in your own global .gitignore file?

@Pablito2020
Copy link
Contributor Author

Thank you for pointing that out! I initially thought the change might have been unintentional because the last commit that touches "code", c07ff23, added the flake.nix file.
So, given this was the last commit. I assumed this might have been overlooked.

From my perspective, I view Nix primarily as a build tool. When a repository includes support for tools like Nix and Direnv, I believe it should also account for ignoring the "artifact" files generated by these tools.
For example, with npm, it's standard to ignore the node_modules directory because it contains dependencies specific to the project. Similarly, Nix stores the results of building derivations in the result symlink, which I think should also be ignored to keep the repository clean.

This was the reasoning behind my PR. That said, I understand that Nix isn't yet a widely adopted tool, so its usage and related conventions might be unfamiliar to some. If you feel this change isn't necessary, I’m happy to close the PR—I just wanted to share the thought process behind it. 😊

@maximbaz
Copy link
Owner

I like this reasoning, thanks for sharing 😁

@maximbaz maximbaz merged commit b59e0e9 into maximbaz:main Nov 21, 2024
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.

2 participants