Change modification time to be consistent with nix store #141
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I investigated why my nginx worked fine on my host nixos but not in the container. I found that nginx is patched to better handle files inside the nix store, but one of the condition is that mtime should be 1. I checked /nix/store on my system and yes all files have mtime 1, then I checked /nix/store files inside the container and mtime is 0
https://github.com/NixOS/nixpkgs/blob/194846768975b7ad2c4988bdb82572c00222c0d7/pkgs/servers/http/nginx/nix-etag-1.15.4.patch#L43
After changing modification time from 0 to 1 in the nix2container that patch started to work as expected