Skip to content

Commit 92b268f

Browse files
committed
Use custom cabal-install
Fixes #210
1 parent 20690c5 commit 92b268f

File tree

7 files changed

+31
-10
lines changed

7 files changed

+31
-10
lines changed

cross-js.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{ self, pkgs, compiler, compiler-nix-name, toolsModule, withHLS ? true, withHlint ? true, withIOG ? true }:
2-
let tool-version-map = import ./tool-map.nix;
2+
let tool-version-map = (import ./tool-map.nix) self;
33
tool = tool-name: pkgs.pkgsBuildBuild.haskell-nix.tool compiler-nix-name tool-name [(tool-version-map compiler-nix-name tool-name) toolsModule];
4-
cabal-install = pkgs.pkgsBuildBuild.haskell-nix.nix-tools-unchecked.exes.cabal;
4+
cabal-install = tool "cabal";
55
haskell-tools =
66
pkgs.lib.optionalAttrs (withHLS && (compiler-not-in (
77
# it appears we can't get HLS build with 9.8 yet.

cross-windows.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{ self, pkgs, compiler, compiler-nix-name, toolsModule, withHLS ? true, withHlint ? true, withIOG ? true }:
2-
let tool-version-map = import ./tool-map.nix;
2+
let tool-version-map = (import ./tool-map.nix) self;
33
tool = tool-name: pkgs.pkgsBuildBuild.haskell-nix.tool compiler-nix-name tool-name [(tool-version-map compiler-nix-name tool-name) toolsModule];
4-
cabal-install = pkgs.pkgsBuildBuild.haskell-nix.nix-tools-unchecked.exes.cabal;
4+
cabal-install = tool "cabal";
55
haskell-tools =
66
pkgs.lib.optionalAttrs (withHLS && (compiler-not-in (
77
# it appears we can't get HLS build with 9.8 yet.

dynamic.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# define a development shell for dynamically linked applications (default)
22
{ self, pkgs, compiler, compiler-nix-name, toolsModule, withHLS ? true, withHlint ? true, withIOG ? true, withIOGFull ? false, withGHCTooling ? false }:
3-
let tool-version-map = import ./tool-map.nix;
3+
let tool-version-map = (import ./tool-map.nix) self;
44
tool = tool-name: pkgs.pkgsBuildBuild.haskell-nix.tool compiler-nix-name tool-name [(tool-version-map compiler-nix-name tool-name) toolsModule];
5-
cabal-install = pkgs.pkgsBuildBuild.haskell-nix.nix-tools-unchecked.exes.cabal;
5+
cabal-install = tool "cabal";
66
haskell-tools =
77
pkgs.lib.optionalAttrs (withHLS && (compiler-not-in (
88
pkgs.lib.optional (builtins.compareVersions compiler.version "9.7" >= 0) compiler-nix-name

flake.lock

Lines changed: 18 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55
inputs.nixpkgs.follows = "haskellNix/nixpkgs-unstable";
66
inputs.flake-utils.url = "github:numtide/flake-utils";
77
inputs.iohk-nix.url = "github:input-output-hk/iohk-nix";
8+
inputs.cabal.url = "github:hsyl20/cabal?ref=hsyl20/per-file-extra-source-options";
9+
inputs.cabal.flake = false;
810

9-
outputs = { self, nixpkgs, flake-utils, haskellNix, iohk-nix }:
11+
outputs = { self, nixpkgs, flake-utils, haskellNix, iohk-nix, ... }:
1012
let overlays = {
1113
inherit (iohk-nix.overlays) crypto;
1214
# add static-$pkg for a few packages to be able to pull them im explicitly.

static.nix

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{ self, pkgs, compiler, compiler-nix-name, toolsModule, withHLS ? true, withHlint ? true, withIOG ? true, withIOGFull ? false }:
2-
let tool-version-map = import ./tool-map.nix;
2+
let tool-version-map = (import ./tool-map.nix) self;
33
tool = tool-name: pkgs.pkgsBuildBuild.haskell-nix.tool compiler-nix-name tool-name [(tool-version-map compiler-nix-name tool-name) toolsModule];
4-
cabal-install = pkgs.pkgsBuildBuild.haskell-nix.nix-tools-unchecked.exes.cabal;
4+
cabal-install = tool "cabal";
55
haskell-tools =
66
pkgs.lib.optionalAttrs (withHLS && (compiler-not-in (
77
pkgs.lib.optional (builtins.compareVersions compiler.version "9.7" >= 0) compiler-nix-name) "Haskell Language Server")) { hls = tool "haskell-language-server"; }

tool-map.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# see https://haskell-language-server.readthedocs.io/en/latest/support/ghc-version-support.html
1+
self: # see https://haskell-language-server.readthedocs.io/en/latest/support/ghc-version-support.html
22
# so we assume "latest" for all hls.
33
# for hlint however, we need hlint-3.3 for ghc-8.10.7.
44
let
@@ -45,4 +45,5 @@ compiler-nix-name: tool: {
4545
};
4646
happy = { version = "1.20.1.1"; inherit cabalProjectLocal; };
4747
alex = { version = "3.2.7.3"; inherit cabalProjectLocal; };
48+
cabal = { src = self.inputs.cabal; };
4849
}.${tool} or fixed-versions.${tool}.${compiler-nix-name} or {}

0 commit comments

Comments
 (0)