From 7cd8f36cc2ca072303db3462e4246d25034b13be Mon Sep 17 00:00:00 2001 From: Ɓukasz Niemier <~@hauleth.dev> Date: Fri, 03 Apr 2026 13:02:58 +0000 Subject: [PATCH] Fix Direnv on macOS --- flake.lock | 18 +++++++++--------- modules/direnv.nix | 11 ++++++++++- 2 file(s) changed, 19 insertion(s)(+), 10 deletion(s)(-) diff --git a/flake.lock b/flake.lock --- a/flake.lock +++ b/flake.lock @@ -91,11 +91,11 @@ "nixpkgs" ] }, "locked": { - "lastModified": 1773778910, - "narHash": "sha256-/k+YKWNxRAufWpDwx3TeHArKEcYu5RreUyqgWTrce64=", + "lastModified": 1774616761, + "narHash": "sha256-pzfNGD4voajXEozJPdOom795D3f+thTrPsj3Dlko2SM=", "owner": "elixir-lang", "repo": "expert", - "rev": "a2a29470fb5e39c9942c9fd8cdbafe9da95d95c8", + "rev": "1bbd0df1ebc79621919096ae4c6f911bf5d91336", "type": "github" }, "original": { @@ -162,11 +162,11 @@ "nixpkgs" ] }, "locked": { - "lastModified": 1773810247, - "narHash": "sha256-6Vz1Thy/1s7z+Rq5OfkWOBAdV4eD+OrvDs10yH6xJzQ=", + "lastModified": 1774584114, + "narHash": "sha256-uWR9fC+4NykFJVn4GN4Ini9LX+w8Llj7BnWKKp0N6bw=", "owner": "nix-community", "repo": "home-manager", - "rev": "d47357a4c806d18a3e853ad2699eaec3c01622e7", + "rev": "4b1be5c38be350ee9452a4847945ce71d950dc31", "type": "github" }, "original": { @@ -177,11 +177,11 @@ } }, "nixpkgs": { "locked": { - "lastModified": 1773628058, - "narHash": "sha256-hpXH0z3K9xv0fHaje136KY872VT2T5uwxtezlAskQgY=", + "lastModified": 1774273680, + "narHash": "sha256-a++tZ1RQsDb1I0NHrFwdGuRlR5TORvCEUksM459wKUA=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "f8573b9c935cfaa162dd62cc9e75ae2db86f85df", + "rev": "fdc7b8f7b30fdbedec91b71ed82f36e1637483ed", "type": "github" }, "original": { diff --git a/modules/direnv.nix b/modules/direnv.nix --- a/modules/direnv.nix +++ b/modules/direnv.nix @@ -1,7 +1,16 @@ -{ ... }: +{ pkgs, ... }: { programs.direnv = { enable = true; + + package = pkgs.direnv.overrideAttrs (old: { + # With CGO disabled the internal linker is used by default; remove the + # explicit -linkmode=external flag from the Makefile which is incompatible + # with CGO_ENABLED=0 (see https://github.com/NixOS/nixpkgs/pull/486452) + postPatch = '' + substituteInPlace GNUmakefile --replace-fail " -linkmode=external" "" + ''; + }); nix-direnv.enable = true; -- tangled.sh