Skip to content

Commit

Permalink
upd: haskell language tools
Browse files Browse the repository at this point in the history
  • Loading branch information
deemp committed Dec 13, 2023
1 parent a69be43 commit 63d3006
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
22 changes: 11 additions & 11 deletions language-tools/haskell/flake.nix
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
inputs.flakes.url = "github:deemp/flakes";
outputs = inputs: inputs.flakes.makeFlake {
inputs = { inherit (inputs.flakes.all) nixpkgs; };
inputs = { inherit (inputs.flakes.all) nixpkgs drv-tools; };
perSystem = { inputs, system }:
let
pkgs = inputs.nixpkgs.legacyPackages.${system};
inherit (builtins) map concatLists attrValues;
inherit (pkgs.lib.lists) genAttrs;
inherit (pkgs.lib.strings) concatMapStringsSep;
inherit (pkgs.lib.attrsets) recursiveUpdate;
concatMapStringsNewline = concatMapStringsSep "\n";
genAttrsId = list: genAttrs list (x: x);
withAttrs = recursiveUpdate;
inherit (inputs.drv-tools.lib.${system}) withMeta concatMapStringsNewline genAttrsId withAttrs getExe;

# `GHC` of a specific version
# With haskell packages that are dependencies of the given packages
ghcGHC = ghcVersion: override: packages:
((haskellPackagesGHCOverride ghcVersion override).ghcWithPackages
(ps: getHaskellPackagesDeps (packages ps))) // { pname = "ghc"; };
withMeta
((haskellPackagesGHCOverride ghcVersion override).ghcWithPackages
(ps: getHaskellPackagesDeps (packages ps)) // { pname = "ghc"; })
(_: { mainProgram = "ghc"; });

# build tool with `GHC` of a specific version available on PATH
buildToolWithFlagsGHC = { name, drv, flags, ghcVersion, override, packages, runtimeDependencies }:
Expand Down Expand Up @@ -85,7 +85,7 @@
# package that contains an executable
package
, # name of the executable
executableName ? package.pname
executableName ? builtins.baseNameOf (getExe package)
, # new name of the executable
binaryName ? executableName
, # runtime dependencies of the executable
Expand Down Expand Up @@ -145,7 +145,7 @@

inherit (haskellPackagesGHC version) callCabal2nix;
implicit-hie = pkgs.haskellPackages.implicit-hie_0_1_4_0;
fourmolu = pkgs.haskellPackages.fourmolu_0_13_0_0;
fourmolu = pkgs.haskellPackages.fourmolu;
inherit (pkgs) ghcid hpack;

haskellPackages = haskellPackagesGHCOverride version override;
Expand Down Expand Up @@ -187,7 +187,7 @@
runtimeDependencies = [ pkgs.hello ];
};

ghcVersion_ = "945";
ghcVersion_ = "948";
executableName = "hello-world";
binaryName = "hello";
test =
Expand All @@ -201,7 +201,7 @@
};
in
{
inherit (tools) cabal stack hls ghc implicit-hie ghcid hpack haskellPackages;
inherit (tools) cabal stack hls ghc implicit-hie ghcid hpack haskellPackages fourmolu;
inherit hello-world;
deps = "${packageName}".getCabalDeps;
};
Expand All @@ -222,7 +222,7 @@
${test.${packageName}}/bin/${binaryName}
'';
buildInputs = __attrValues {
inherit (test) cabal stack hls ghc implicit-hie ghcid hpack;
inherit (test) cabal stack hls ghc implicit-hie ghcid hpack fourmolu;
};
};
};
Expand Down
2 changes: 1 addition & 1 deletion language-tools/haskell/stack.yaml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
resolver: nightly-2023-06-10
resolver: lts-21.24
8 changes: 4 additions & 4 deletions language-tools/haskell/stack.yaml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
packages: []
snapshots:
- completed:
sha256: e0e80195c91d8d8daefd1ef71cf470b0e59124f98abe946a2390bbf88a410a46
size: 632966
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/nightly/2023/6/10.yaml
original: nightly-2023-06-10
sha256: abcc4a65c15c7c2313f1a87f01bfd4d910516e1930b99653eef1d2d006515916
size: 640074
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/21/24.yaml
original: lts-21.24

0 comments on commit 63d3006

Please sign in to comment.