diff --git a/flake.lock b/flake.lock --- a/flake.lock +++ b/flake.lock @@ -2,11 +2,11 @@ "nodes": { "nixpkgs": { "locked": { - "lastModified": 1655481042, - "narHash": "sha256-XHbcywq2vIQ5CeH1OK3TN793jkiNAAZsSctS1PFgseo=", + "lastModified": 1658644204, + "narHash": "sha256-MWyfCH9K3eVTXJUxBi67OQSAh9jJAnvWklM6qm4j8w8=", "owner": "nixos", "repo": "nixpkgs", - "rev": "103a4c0ae46afa9cf008c30744175315ca38e9f9", + "rev": "2f0c3be57c348f4cfd8820f2d189e29a685d9c41", "type": "github" }, "original": { diff --git a/nix/overlay.nix b/nix/overlay.nix --- a/nix/overlay.nix +++ b/nix/overlay.nix @@ -73,6 +73,23 @@ url = "https://nodejs.org/dist/v${version}/node-v${version}.tar.xz"; sha256 = "sha256-MhFLPcOUXtD5X4vDO0LGjg7xjECMtWEiVyoWPZB+y8w="; }; + + # Nixpkgs applies two patches for 16.15. One patch is for finding headers + # needed for v8 on darwin using apple_sdk 11; the other patch fixes crashes + # related cache dir defaulting to using `$HOME` without asserting that + # it exists. + # + # However, 16.13 doesn't need the second patch, as the regression which + # caused it was introduced after 16.13. This ends up being a no-op. But + # nix will still try to apply the patch and fail with "this patch has + # already been applied". + # + # For more context, see (https://github.com/npm/cli/pull/5197) + # + # lib.head will select the first element in an array + patches = [ + (prev.lib.head oldAttrs.patches) + ]; }); # Ensure that yarn is using the pinned version