News for hackers. Stuff that matters.
Re:Nix 2.0 Released by thinkpad20 on Thursday February 22, 2018 @08:27PM (#16443395)
As a nix user for several years this is pretty exciting. I hadn’t been following the 2.0 development, but I was really hoping to see a mention of support for something like a .gitignore equivalent when hashing directories from the filesystem. Seems that that isn’t in this release :(
Re:Nix 2.0 Released by dtzWill on Friday February 23, 2018 @01:51AM (#16444710)
If what you're dealing with is actually a git repository, in 2.0 you can just use "src = fetchGit ./.;"-- this is what the expression for building Nix itself does :).

Otherwise you can use filterSource (documented in the linked article, the Nix manual) to roll your own filtering.

If you have any problems with either of these I encourage you to join #nixos on freenode and ask. Hope this helps! :)

Re:Nix 2.0 Released by lukego on Friday February 23, 2018 @04:37AM (#16445244)
Have you seen the library function cleanSource() and related routines? I use these for excluding files (e.g. by filename extension) from being visible in builds. This might suit your use case too.

https://github.com/NixOS/nixpkgs/blob/master/lib/sources.nix

Re:Nix 2.0 Released by thinkpad20 on Friday February 23, 2018 @12:11PM (#16447630)
Yeah, and I use cleanSource, but I find it to be pretty obtuse and full of edge cases.