From bf080a5c5b63aad0877f1dd79456bb95a099126e Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Tue, 16 Jul 2024 18:25:33 -0600 Subject: [PATCH 1/2] Clean up devShell definition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mostly formatting, but also - removes Apple’s Cocoa from the dependencies, - moves some dependencies from `buildInputs` to `nativeBuildInputs`. --- nix/haskell-nix-flake.nix | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/nix/haskell-nix-flake.nix b/nix/haskell-nix-flake.nix index 97c8f1ebc0..fa2b246a90 100644 --- a/nix/haskell-nix-flake.nix +++ b/nix/haskell-nix-flake.nix @@ -12,15 +12,29 @@ # https://github.com/input-output-hk/haskell.nix/issues/1793 # https://github.com/input-output-hk/haskell.nix/issues/1885 allToolDeps = false; - additional = hpkgs: with hpkgs; [Cabal stm exceptions ghc ghc-heap]; - buildInputs = let - native-packages = - lib.optionals pkgs.stdenv.isDarwin - (with pkgs.darwin.apple_sdk.frameworks; [Cocoa]); - in + + additional = hpkgs: + (args.additional or (_: [])) hpkgs + ++ [ + hpkgs.Cabal + hpkgs.exceptions + hpkgs.ghc + hpkgs.ghc-heap + hpkgs.stm + ]; + buildInputs = (args.buildInputs or []) - ++ [pkgs.stack-wrapped pkgs.hpack pkgs.pkg-config pkgs.zlib pkgs.glibcLocales] - ++ native-packages; + ++ [ + pkgs.glibcLocales + pkgs.zlib + ]; + nativeBuildInputs = + (args.nativeBuildInputs or []) + ++ [ + pkgs.hpack + pkgs.pkg-config + pkgs.stack-wrapped + ]; # workaround for https://gitlab.haskell.org/ghc/ghc/-/issues/11042 shellHook = '' export LD_LIBRARY_PATH=${pkgs.zlib}/lib:$LD_LIBRARY_PATH From f18943284ec4f03136c7b653619fee5bcfb83908 Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Tue, 16 Jul 2024 18:28:27 -0600 Subject: [PATCH 2/2] Add `cachix` to the devShell MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This tool manages the Unison cache, so it’s useful to provide in dev environments. Actually pushing to the cache requires a secret key. --- nix/haskell-nix-flake.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/nix/haskell-nix-flake.nix b/nix/haskell-nix-flake.nix index fa2b246a90..ac4764c781 100644 --- a/nix/haskell-nix-flake.nix +++ b/nix/haskell-nix-flake.nix @@ -31,6 +31,7 @@ nativeBuildInputs = (args.nativeBuildInputs or []) ++ [ + pkgs.cachix pkgs.hpack pkgs.pkg-config pkgs.stack-wrapped