nix-community / yarn2nix

Generate nix expressions from a yarn.lock file [maintainer=???]
GNU General Public License v3.0
123 stars 61 forks source link

Exposing the version in the derivative #70

Open Akii opened 6 years ago

Akii commented 6 years ago

So basically I use yarn2nix to generate a derivative that I then serve with nginx. Turns out, /nix/store has all timestamps set to epoch +1 second which breaks caching nginx uses for static files.

Now, to work around that I thought it would be perfect if I just used an etag with the application name and version since increasing the version should invalidate the browser cache.

Long story short: it'd be nice if I had the version in nix.

https://github.com/Akii/yarn2nix/commit/848530ab5f210d4e8ab50d792afba80c5f53f286