1# This overlay helps accessing common executable components.
2# Typically we want to make these available in a nix-shell
3# created with shellFor. In most cases the package name
4# will be the same as the executable, but we have a
5# `toolPackageName` and `packageToolName` mapping to help
9# haskell-nix.tool "ghc884" "cabal" "3.2.0.0"
11# This does the same thing as:
12# (haskell-nix.hackage-package {
13# compiler-nix-name = "ghc884";
14# name = "cabal-install"
16# }).components.exes.cabal
18# To get an attr set containing multiple tools:
19# haskell-nix.tools "ghc884" { cabal = "3.2.0.0"; hlint = "2.2.11"; }
21# To add tools to a shell:
22# shellFor { tools = { cabal = "3.2.0.0"; hlint = "2.2.11"; }; }
24# When used in shellFor the tools will be compiled with the same version
25# of ghc used in the shell (the build ghc in the case of cross compilation).
27# To get tools for use with project `p` without using shellFor:
28# p.tool "cabal" "3.2.0.0"
29# p.tools { cabal = "3.2.0.0"; hlint = "2.2.11"; }
30# (the ghc version used to build it will match the one used in the project)
32# Instead of a version string we can use an attr set containing
33# arguments that will be passed to `cabalProject`.
35# For instance to add haskell.nix modules. Use:
36# haskell-nix.tool "ghc884" "cabal" {
45in { haskell-nix = prev.haskell-nix // {
47 # Some times the package name in hackage is not the same as tool name.
48 # Tools better known by their exe name.
50 cabal = "cabal-install";
53 # Packages that are better known by their package name. We are not
54 # reusing toolPackageName here as perhaps the more one package
55 # will have the same exe name.
57 cabal-install = "cabal";
60 hackage-tool = { name, ... }@args':
62 args = { caller = "hackage-tool"; } // args';
64 (final.haskell-nix.hackage-package
65 (args // { name = final.haskell-nix.toolPackageName.${name} or name; }))
66 .components.exes."${final.haskell-nix.packageToolName.${name} or name}";
68 tool = compiler-nix-name: name: versionOrArgs:
70 args' = final.haskell-nix.haskellLib.versionOrArgsToArgs versionOrArgs;
71 args = { inherit compiler-nix-name; } // args';
73 (if final.haskell-nix.custom-tools ? "${name}"
74 && final.haskell-nix.custom-tools."${name}" ? "${args.version}"
75 then final.haskell-nix.custom-tools."${name}"."${args.version}"
76 else final.haskell-nix.hackage-tool) (args // { inherit name; });
78 tools = compiler-nix-name: lib.mapAttrs (final.haskell-nix.tool compiler-nix-name);
80 # Like `tools` but allows default ghc to be specified
81 toolsForGhc = ghcOverride: toolSet:
82 final.haskell-nix.tools (
83 lib.mapAttrs (name: versionOrArgs:
84 let args = final.haskell-nix.haskellLib.versionOrArgsToArgs versionOrArgs;
86 # Add default ghc if not specified in the args
87 (lib.optionalAttrs (!(args ? "compiler-nix-name" || args ? "ghc"))
88 { inherit ghcOverride; }
93 # Tools not in hackage yet
94 # When adding custom tools here, consider adding them
95 # to the `tools` attribute defined in `build.nix` to make
96 # sure they are cached.
98 ghcide.object-code = args:
99 (final.haskell-nix.cabalProject (args // {
101 src = final.fetchFromGitHub {
102 owner = "mpickering";
104 rev = "706c59c97c25c66798815c1dc3ee6885a298918a";
105 sha256 = "0d158xifwvz0y69ah98ckxakzqpz229mq7rpf2bpbmwhnpw3jmm6";
107 modules = [({config, ...}: {
108 packages.ghcide.configureFlags = lib.optional (!final.stdenv.targetPlatform.isMusl)
109 "--enable-executable-dynamic";
110 nonReinstallablePkgs = [ "Cabal" "array" "base" "binary" "bytestring" "containers" "deepseq"
111 "directory" "filepath" "ghc" "ghc-boot" "ghc-boot-th" "ghc-compact"
112 "ghc-heap" "ghc-prim" "ghci" "haskeline" "hpc" "integer-gmp"
113 "libiserv" "mtl" "parsec" "pretty" "process" "rts" "stm"
114 "template-haskell" "terminfo" "text" "time" "transformers" "unix"
121 "alex" = (((hackage.alex)."3.2.5").revisions).default;
122 "happy" = (((hackage.happy)."1.19.12").revisions).default;
126 })).ghcide.components.exes.ghcide;
128 haskell-language-server."0.5.1" = args:
129 (final.haskell-nix.cabalProject ( args // {
130 name = "haskell-language-server";
131 src = final.fetchFromGitHub {
133 repo = "haskell-language-server";
135 sha256 = "17nzgpiacmrvwsy2fjx6a6pcpkncqcwfhaijvajm16jpdgni8mik";
136 fetchSubmodules = true;
139 "https://github.com/bubba/brittany.git"."c59655f10d5ad295c2481537fc8abf0a297d9d1c" = "1rkk09f8750qykrmkqfqbh44dbx1p8aq1caznxxlw8zqfvx39cxl";
141 # Plan issues with the benchmarks, can try removing later
142 configureArgs = "--disable-benchmarks";
144 # Tests don't pass for some reason, but this is a somewhat random revision.
145 packages.haskell-language-server.doCheck = false;
147 })).haskell-language-server.components.exes.haskell-language-server;
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list