Skip to content

Commit

Permalink
@amesgen advices me a better way to write "if macOS" :)
Browse files Browse the repository at this point in the history
  • Loading branch information
yvan-sraka committed Mar 13, 2023
1 parent fafa4d1 commit 5fcd22a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions dynamic.nix
@@ -1,5 +1,5 @@
# define a development shell for dynamically linked applications (default)
{ system, pkgs, compiler, compiler-nix-name, withHLS ? true, withHlint ? true }:
{ pkgs, compiler, compiler-nix-name, withHLS ? true, withHlint ? true }:
let tool-version-map = import ./tool-map.nix;
tool = tool-name: pkgs.haskell-nix.tool compiler-nix-name tool-name (tool-version-map compiler-nix-name tool-name);
cabal-install = tool "cabal"; in
Expand All @@ -24,7 +24,7 @@ pkgs.mkShell {
;;
esac
}
'' ++ (if system == "darwin-aarch64" || system == "darwin-x86_64" then ''
'' ++ (if pkgs.stdenv.targetPlatform.isMacOS then ''
# this one is only needed on macOS right now, due to a bug in loading libcrypto.
export DYLD_LIBRARY_PATH=$(pkg-config --libs-only-L libcrypto|cut -c 3-)
'' else "");
Expand Down
8 changes: 4 additions & 4 deletions flake.nix
Expand Up @@ -107,19 +107,19 @@
else pkgs.pkgsCross.musl64
else pkgs;
in (builtins.mapAttrs (compiler-nix-name: compiler:
import ./dynamic.nix { inherit system pkgs compiler compiler-nix-name; }
import ./dynamic.nix { inherit pkgs compiler compiler-nix-name; }
) (compilers pkgs)
// pkgs.lib.mapAttrs' (compiler-nix-name: compiler:
pkgs.lib.nameValuePair "${compiler-nix-name}-minimal" (
import ./dynamic.nix { inherit system pkgs compiler compiler-nix-name; withHLS = false; withHlint = false; }
import ./dynamic.nix { inherit pkgs compiler compiler-nix-name; withHLS = false; withHlint = false; }
)) (compilers pkgs)
// pkgs.lib.mapAttrs' (compiler-nix-name: compiler:
pkgs.lib.nameValuePair "${compiler-nix-name}-static" (
import ./static.nix { pkgs = static-pkgs; inherit system compiler compiler-nix-name; }
import ./static.nix { pkgs = static-pkgs; inherit compiler compiler-nix-name; }
)) (compilers static-pkgs.buildPackages)
// pkgs.lib.mapAttrs' (compiler-nix-name: compiler:
pkgs.lib.nameValuePair "${compiler-nix-name}-static-minimal" (
import ./static.nix { pkgs = static-pkgs; inherit system compiler compiler-nix-name; withHLS = false; withHlint = false; }
import ./static.nix { pkgs = static-pkgs; inherit compiler compiler-nix-name; withHLS = false; withHlint = false; }
)) (compilers static-pkgs.buildPackages)
);
hydraJobs = devShells;
Expand Down
4 changes: 2 additions & 2 deletions static.nix
@@ -1,4 +1,4 @@
{ system, pkgs, compiler, compiler-nix-name, withHLS ? true, withHlint ? true }:
{ pkgs, compiler, compiler-nix-name, withHLS ? true, withHlint ? true }:
let tool-version-map = import ./tool-map.nix;
tool = tool-name: pkgs.haskell-nix.tool compiler-nix-name tool-name (tool-version-map compiler-nix-name tool-name);
cabal-install = tool "cabal"; in
Expand Down Expand Up @@ -75,7 +75,7 @@ pkgs.mkShell ({
done
}
'' ++ (if system == "darwin-aarch64" || system == "darwin-x86_64" then ''
'' ++ (if pkgs.stdenv.targetPlatform.isMacOS then ''
# this one is only needed on macOS right now, due to a bug in loading libcrypto.
export DYLD_LIBRARY_PATH=$(pkg-config --libs-only-L libcrypto|cut -c 3-)
'' else "");
Expand Down

0 comments on commit 5fcd22a

Please sign in to comment.