2021-05-19 10:32:23 +03:00
# Maintaining this file:
#
# - Bump the inputs version using `nix flake update`
# - Edit `sourceDirs` to update the set of local packages
#
# For more details: https://nixos.wiki/wiki/Flakes
{
description = " h a s k e l l l a n g u a g e s e r v e r f l a k e " ;
inputs = {
nixpkgs . url = " g i t h u b : N i x O S / n i x p k g s / n i x p k g s - u n s t a b l e " ;
flake-compat = {
url = " g i t h u b : e d o l s t r a / f l a k e - c o m p a t " ;
flake = false ;
} ;
flake-utils . url = " g i t h u b : n u m t i d e / f l a k e - u t i l s " ;
gitignore = {
url = " g i t h u b : h e r c u l e s - c i / g i t i g n o r e . n i x " ;
flake = false ;
} ;
2022-01-01 17:28:08 +03:00
2022-01-29 16:41:54 +03:00
# List of hackage dependencies
lsp = {
url = " h t t p s : / / h a c k a g e . h a s k e l l . o r g / p a c k a g e / l s p - 1 . 4 . 0 . 0 / l s p - 1 . 4 . 0 . 0 . t a r . g z " ;
flake = false ;
} ;
lsp-types = {
url = " h t t p s : / / h a c k a g e . h a s k e l l . o r g / p a c k a g e / l s p - t y p e s - 1 . 4 . 0 . 1 / l s p - t y p e s - 1 . 4 . 0 . 1 . t a r . g z " ;
flake = false ;
} ;
lsp-test = {
url = " h t t p s : / / h a c k a g e . h a s k e l l . o r g / p a c k a g e / l s p - t e s t - 0 . 1 4 . 0 . 2 / l s p - t e s t - 0 . 1 4 . 0 . 2 . t a r . g z " ;
flake = false ;
} ;
2022-05-13 12:09:51 +03:00
ghc-exactprint-150 = {
url = " h t t p s : / / h a c k a g e . h a s k e l l . o r g / p a c k a g e / g h c - e x a c t p r i n t - 1 . 5 . 0 / g h c - e x a c t p r i n t - 1 . 5 . 0 . t a r . g z " ;
flake = false ;
} ;
2022-01-29 16:41:54 +03:00
ghc-exactprint = {
url = " h t t p s : / / h a c k a g e . h a s k e l l . o r g / p a c k a g e / g h c - e x a c t p r i n t - 1 . 4 . 1 / g h c - e x a c t p r i n t - 1 . 4 . 1 . t a r . g z " ;
flake = false ;
} ;
constraints-extras = {
url = " h t t p s : / / h a c k a g e . h a s k e l l . o r g / p a c k a g e / c o n s t r a i n t s - e x t r a s - 0 . 3 . 2 . 1 / c o n s t r a i n t s - e x t r a s - 0 . 3 . 2 . 1 . t a r . g z " ;
flake = false ;
} ;
retrie = {
url = " h t t p s : / / h a c k a g e . h a s k e l l . o r g / p a c k a g e / r e t r i e - 1 . 2 . 0 . 1 / r e t r i e - 1 . 2 . 0 . 1 . t a r . g z " ;
flake = false ;
} ;
fourmolu = {
url = " h t t p s : / / h a c k a g e . h a s k e l l . o r g / p a c k a g e / f o u r m o l u - 0 . 5 . 0 . 1 / f o u r m o l u - 0 . 5 . 0 . 1 . t a r . g z " ;
flake = false ;
} ;
2022-05-13 12:09:51 +03:00
fourmolu-0300 = {
url = " h t t p s : / / h a c k a g e . h a s k e l l . o r g / p a c k a g e / f o u r m o l u - 0 . 3 . 0 . 0 / f o u r m o l u - 0 . 3 . 0 . 0 . t a r . g z " ;
flake = false ;
} ;
aeson-1520 = {
url = " h t t p s : / / h a c k a g e . h a s k e l l . o r g / p a c k a g e / a e s o n - 1 . 5 . 2 . 0 / a e s o n - 1 . 5 . 2 . 0 . t a r . g z " ;
flake = false ;
} ;
brittany-01312 = {
url = " h t t p s : / / h a c k a g e . h a s k e l l . o r g / p a c k a g e / b r i t t a n y - 0 . 1 3 . 1 . 2 / b r i t t a n y - 0 . 1 3 . 1 . 2 . t a r . g z " ;
flake = false ;
} ;
2022-01-29 16:41:54 +03:00
hlint = {
url = " h t t p s : / / h a c k a g e . h a s k e l l . o r g / p a c k a g e / h l i n t - 3 . 3 . 6 / h l i n t - 3 . 3 . 6 . t a r . g z " ;
flake = false ;
} ;
2022-05-13 12:09:51 +03:00
hlint-34 = {
url = " h t t p s : / / h a c k a g e . h a s k e l l . o r g / p a c k a g e / h l i n t - 3 . 4 / h l i n t - 3 . 4 . t a r . g z " ;
flake = false ;
} ;
ptr-poker = {
url = " h t t p s : / / h a c k a g e . h a s k e l l . o r g / p a c k a g e / p t r - p o k e r - 0 . 1 . 2 . 8 / p t r - p o k e r - 0 . 1 . 2 . 8 . t a r . g z " ;
flake = false ;
} ;
stylish-haskell-01220 = {
url = " h t t p s : / / h a c k a g e . h a s k e l l . o r g / p a c k a g e / s t y l i s h - h a s k e l l - 0 . 1 2 . 2 . 0 / s t y l i s h - h a s k e l l - 0 . 1 2 . 2 . 0 . t a r . g z " ;
flake = false ;
} ;
Nix flake fix dev shells (#2655)
* nix: ghc92: ignore broken plugins
* nix: use current ghc for tools in the shell
Theses tools are pulled in the shell, but we don't need them to match
the GHC version used for development. Said otherwise, as long as we use
a working `cabal-install` to build with GHC 9.2, we don't care if that
cabal-install was built with GHC 8.10.
This gives more chance for theses tools to work and be in the binary
cache of nixpkgs.
* nix: disable shake-bench for ghc921
* nix: fix ghc 9.2 shell
* nix: explicit cabal project in devShell
Using alias, we get the "correct" behavior when typing `cabal build` in
the nix-shell, it points to the current cabal-project file.
* nix: remove special case for different ghc versions
* nix: move implicit-hie-cradle as a flake input
* nix: restore dev shell
This commit restores a working behavior for `nix-shell` or `nix
develop`, for all supported GHC versions.
When entering a `nix-shell`, or `nix develop
.#haskell-language-server-ghcXxX-dev` you will get an environment with
all the dependencies needed to run `cabal build`.
Haskell dependencies will be built by cabal instead of nix. This may be
more robust compared to a shell where dependencies are built by nix:
- It won't try to build any dependency with nix. This mean that it won't
benefit from nix caching, but on the other hand, it will perfectly
match the cabal plan.
- The nix shell may fail to start if an (possibly unneeded) dependency
was failing to build.
Entering nix-shell also generates an alias command `cabal_project` which
runs cabal with the correct project file if needed (e.g. for GHC 9.0 and
9.2). Users are notified with a message when entering the shell.
The old behavior (i.e. where dependencies are built with nix) is still
available with `nix develop .#haskell-language-server-xxx-dev-nix` (i.e.
suffix the name of the shell with `-nix`).
* nix: New entries which build all target at once
All HLS version can be built with `nix build
.#all-haskell-language-server`, and all development shells with `nix
build .#all-dev-shells`.
I had to workaround a limitation in `nix build` which is not able to
build multiples targets, instead I used linkFarmFromDrvs.
All packages and shells are now named with a unique package name
containing the GHC version.
* nix: Build all devShells and all binaries in CI
* nix: build HLS with dynamic linking
Related to #2668.
This fixs the build, however, because now HLS is dynamicly linked, it
pulls GHC as a dependency. The uncompressed closure size is now `~6GiB`.
* nix; fix CI command
* nix: only build dev shell with nix packages for current GHC version
* Another tentative to fix the build
* fix: Eval and alternate number format works with ghc 9.2
* fix CI build
* ANother tentative fix
2022-02-16 15:24:22 +03:00
implicit-hie-cradle = {
url = " h t t p s : / / h a c k a g e . h a s k e l l . o r g / p a c k a g e / i m p l i c i t - h i e - c r a d l e - 0 . 3 . 0 . 5 / i m p l i c i t - h i e - c r a d l e - 0 . 3 . 0 . 5 . t a r . g z " ;
flake = false ;
} ;
2022-02-27 17:21:20 +03:00
hie-bios = {
2022-03-08 16:24:00 +03:00
url = " h t t p s : / / h a c k a g e . h a s k e l l . o r g / p a c k a g e / h i e - b i o s - 0 . 9 . 1 / h i e - b i o s - 0 . 9 . 1 . t a r . g z " ;
2022-02-27 17:21:20 +03:00
flake = false ;
} ;
2022-05-13 12:09:51 +03:00
myst-parser = {
2022-06-28 11:54:32 +03:00
url = " g i t h u b : s m u n i x / M y S T - P a r s e r ? r e f = f i x . h l s - d o c u t i l s " ;
2022-05-13 12:09:51 +03:00
flake = false ;
} ;
# For https://github.com/readthedocs/sphinx_rtd_theme/pull/1185, otherwise lists are broken locally
sphinx_rtd_theme = {
url = " g i t h u b : r e a d t h e d o c s / s p h i n x _ r t d _ t h e m e ? r e v = 3 4 f 8 1 d a a f 5 2 4 6 6 3 6 6 c 8 0 0 0 3 d b 2 9 3 d 5 0 0 7 5 c 1 b 8 9 6 " ;
flake = false ;
} ;
poetry2nix . url = " g i t h u b : n i x - c o m m u n i t y / p o e t r y 2 n i x / m a s t e r " ;
2021-05-19 10:32:23 +03:00
} ;
outputs =
2022-06-28 11:54:32 +03:00
inputs @ { self , nixpkgs , flake-compat , flake-utils , gitignore , . . . }:
2021-05-19 10:32:23 +03:00
{
2022-05-13 12:09:51 +03:00
overlays . default = final : prev :
2021-05-19 10:32:23 +03:00
with prev ;
let
2021-07-04 08:15:04 +03:00
haskellOverrides = hself : hsuper : {
# we override mkDerivation here to apply the following
# tweak to each haskell package:
# if the package is broken, then we disable its check and relax the cabal bounds;
# otherwise, we leave it unchanged.
# hopefully, this could fix packages marked as broken by nix due to check failures
# or the build failure because of tight cabal bounds
mkDerivation = args :
let
broken = args . broken or false ;
check = args . doCheck or true ;
jailbreak = args . jailbreak or false ;
in hsuper . mkDerivation ( args // {
jailbreak = if broken then true else jailbreak ;
doCheck = if broken then false else check ;
2022-06-28 11:54:32 +03:00
# Library profiling is disabled as it causes long compilation time
2022-05-13 12:09:51 +03:00
# on our CI jobs. Nix users are free tor revert this anytime.
enableLibraryProfiling = false ;
doHaddock = false ;
2021-07-04 08:15:04 +03:00
} ) ;
2021-05-19 10:32:23 +03:00
} ;
gitignoreSource = ( import gitignore { inherit lib ; } ) . gitignoreSource ;
# List all subdirectories under `./plugins`, except `./plugins/default`
pluginsDir = ./plugins ;
pluginSourceDirs = builtins . removeAttrs ( lib . mapAttrs'
( name : _ : lib . nameValuePair name ( pluginsDir + ( " / " + name ) ) )
( builtins . readDir pluginsDir ) ) [ " d e f a u l t " ] ;
# Source directories of our packages, should be consistent with cabal.project
sourceDirs = {
haskell-language-server = ./. ;
ghcide = ./ghcide ;
hls-graph = ./hls-graph ;
shake-bench = ./shake-bench ;
hie-compat = ./hie-compat ;
hls-plugin-api = ./hls-plugin-api ;
hls-test-utils = ./hls-test-utils ;
} // pluginSourceDirs ;
# Tweak our packages
2021-05-27 07:33:28 +03:00
# Don't use `callHackage`, it requires us to override `all-cabal-hashes`
2021-05-19 10:32:23 +03:00
tweaks = hself : hsuper :
with haskell . lib ; {
2021-12-08 18:57:15 +03:00
# Patches don't apply
github = overrideCabal hsuper . github ( drv : { patches = [ ] ; } ) ;
2022-03-08 16:24:00 +03:00
# GHCIDE requires hie-bios ^>=0.9.1
2022-02-27 17:21:20 +03:00
hie-bios = hself . callCabal2nix " h i e - b i o s " inputs . hie-bios { } ;
2021-12-09 22:38:11 +03:00
2022-01-29 16:41:54 +03:00
lsp = hsuper . callCabal2nix " l s p " inputs . lsp { } ;
lsp-types = hsuper . callCabal2nix " l s p - t y p e s " inputs . lsp-types { } ;
lsp-test = hsuper . callCabal2nix " l s p - t e s t " inputs . lsp-test { } ;
2022-01-01 17:28:08 +03:00
Nix flake fix dev shells (#2655)
* nix: ghc92: ignore broken plugins
* nix: use current ghc for tools in the shell
Theses tools are pulled in the shell, but we don't need them to match
the GHC version used for development. Said otherwise, as long as we use
a working `cabal-install` to build with GHC 9.2, we don't care if that
cabal-install was built with GHC 8.10.
This gives more chance for theses tools to work and be in the binary
cache of nixpkgs.
* nix: disable shake-bench for ghc921
* nix: fix ghc 9.2 shell
* nix: explicit cabal project in devShell
Using alias, we get the "correct" behavior when typing `cabal build` in
the nix-shell, it points to the current cabal-project file.
* nix: remove special case for different ghc versions
* nix: move implicit-hie-cradle as a flake input
* nix: restore dev shell
This commit restores a working behavior for `nix-shell` or `nix
develop`, for all supported GHC versions.
When entering a `nix-shell`, or `nix develop
.#haskell-language-server-ghcXxX-dev` you will get an environment with
all the dependencies needed to run `cabal build`.
Haskell dependencies will be built by cabal instead of nix. This may be
more robust compared to a shell where dependencies are built by nix:
- It won't try to build any dependency with nix. This mean that it won't
benefit from nix caching, but on the other hand, it will perfectly
match the cabal plan.
- The nix shell may fail to start if an (possibly unneeded) dependency
was failing to build.
Entering nix-shell also generates an alias command `cabal_project` which
runs cabal with the correct project file if needed (e.g. for GHC 9.0 and
9.2). Users are notified with a message when entering the shell.
The old behavior (i.e. where dependencies are built with nix) is still
available with `nix develop .#haskell-language-server-xxx-dev-nix` (i.e.
suffix the name of the shell with `-nix`).
* nix: New entries which build all target at once
All HLS version can be built with `nix build
.#all-haskell-language-server`, and all development shells with `nix
build .#all-dev-shells`.
I had to workaround a limitation in `nix build` which is not able to
build multiples targets, instead I used linkFarmFromDrvs.
All packages and shells are now named with a unique package name
containing the GHC version.
* nix: Build all devShells and all binaries in CI
* nix: build HLS with dynamic linking
Related to #2668.
This fixs the build, however, because now HLS is dynamicly linked, it
pulls GHC as a dependency. The uncompressed closure size is now `~6GiB`.
* nix; fix CI command
* nix: only build dev shell with nix packages for current GHC version
* Another tentative to fix the build
* fix: Eval and alternate number format works with ghc 9.2
* fix CI build
* ANother tentative fix
2022-02-16 15:24:22 +03:00
implicit-hie-cradle = hself . callCabal2nix " i m p l i c i t - h i e - c r a d l e " inputs . implicit-hie-cradle { } ;
2022-01-03 19:20:13 +03:00
# https://github.com/NixOS/nixpkgs/issues/140774
ormolu =
if final . system == " a a r c h 6 4 - d a r w i n "
then overrideCabal hsuper . ormolu ( _ : { enableSeparateBinOutput = false ; } )
else hsuper . ormolu ;
2021-05-19 10:32:23 +03:00
} ;
hlsSources =
builtins . mapAttrs ( _ : dir : gitignoreSource dir ) sourceDirs ;
extended = hpkgs :
2021-07-04 08:15:04 +03:00
( hpkgs . override ( old : {
overrides = lib . composeExtensions ( old . overrides or ( _ : _ : { } ) )
haskellOverrides ;
} ) ) . extend ( hself : hsuper :
2021-05-19 10:32:23 +03:00
# disable all checks for our packages
builtins . mapAttrs ( _ : drv : haskell . lib . dontCheck drv )
( lib . composeExtensions
( haskell . lib . packageSourceOverrides hlsSources ) tweaks hself
hsuper ) ) ;
in {
inherit hlsSources ;
# Haskell packages extended with our packages
hlsHpkgs = compiler : extended haskell . packages . ${ compiler } ;
# Support of GenChangelogs.hs
2021-07-01 19:57:50 +03:00
gen-hls-changelogs = hpkgs :
let myGHC = hpkgs . ghcWithPackages ( p : with p ; [ github ] ) ;
2021-05-19 10:32:23 +03:00
in runCommand " g e n - h l s - c h a n g e l o g s " {
passAsFile = [ " t e x t " ] ;
preferLocalBuild = true ;
allowSubstitutes = false ;
buildInputs = [ git myGHC ] ;
} ''
dest = $ out/bin/gen-hls-changelogs
mkdir - p $ out/bin
echo " # ! ${ runtimeShell } " > > $ dest
echo " ${ myGHC } / b i n / r u n g h c ${ ./GenChangelogs.hs } " > > $ dest
chmod + x $ dest
'' ;
} ;
2022-01-03 19:20:13 +03:00
} // ( flake-utils . lib . eachSystem [ " x 8 6 _ 6 4 - l i n u x " " x 8 6 _ 6 4 - d a r w i n " " a a r c h 6 4 - d a r w i n " ] )
2021-05-19 10:32:23 +03:00
( system :
let
pkgs = import nixpkgs {
inherit system ;
2022-05-13 12:09:51 +03:00
overlays = [ self . overlays . default inputs . poetry2nix . overlay ] ;
2021-05-19 10:32:23 +03:00
config = { allowBroken = true ; } ;
} ;
2022-05-13 12:09:51 +03:00
ghc902Config = ( import ./configuration-ghc-90.nix ) { inherit pkgs inputs ; } ;
ghc922Config = ( import ./configuration-ghc-92.nix ) { inherit pkgs inputs ; } ;
2021-07-04 08:15:04 +03:00
2021-05-19 10:32:23 +03:00
# GHC versions
2022-06-28 11:54:32 +03:00
# While HLS still works fine with 8.10 GHCs, we only support the versions that are cached
2022-05-13 12:09:51 +03:00
# by upstream nixpkgs, which now only includes GHC version 9+
supportedGHCs = let
ghcVersion = " g h c " + ( pkgs . lib . replaceStrings [ " . " ] [ " " ] pkgs . haskellPackages . ghc . version ) ;
cases = {
ghc902 = ghc902Config . tweakHpkgs ( pkgs . hlsHpkgs " g h c 9 0 2 " ) ;
ghc922 = ghc922Config . tweakHpkgs ( pkgs . hlsHpkgs " g h c 9 2 2 " ) ;
} ;
in { default = cases . " ${ ghcVersion } " ; } // cases ;
ghc902 = supportedGHCs . ghc902 ;
ghc922 = supportedGHCs . ghc922 ;
ghcDefault = supportedGHCs . default ;
2021-05-19 10:32:23 +03:00
2021-08-11 11:54:51 +03:00
# For markdown support
2022-05-13 12:09:51 +03:00
myst-parser = pkgs . poetry2nix . mkPoetryEnv {
projectDir = inputs . myst-parser ;
python = pkgs . python39 ;
2022-06-28 11:54:32 +03:00
overrides = [
2022-05-13 12:09:51 +03:00
pkgs . poetry2nix . defaultPoetryOverrides
] ;
} ;
sphinx_rtd_theme = pkgs . poetry2nix . mkPoetryEnv {
projectDir = inputs . sphinx_rtd_theme ;
python = pkgs . python39 ;
2022-06-28 11:54:32 +03:00
overrides = [
2022-05-13 12:09:51 +03:00
pkgs . poetry2nix . defaultPoetryOverrides
( self : super : {
# The RTD theme doesn't work with newer docutils
docutils = pkgs . python3Packages . callPackage ./docutils.nix { } ;
} )
] ;
} ;
2021-08-11 11:54:51 +03:00
pythonWithPackages = pkgs . python3 . withPackages ( ps : [ ps . sphinx myst-parser sphinx_rtd_theme ps . pip ] ) ;
docs = pkgs . stdenv . mkDerivation {
name = " h l s - d o c s " ;
2021-12-18 15:23:13 +03:00
src = pkgs . lib . sourceFilesBySuffices ./. [ " . p y " " . r s t " " . m d " " . p n g " " . g i f " " . s v g " " . c a b a l " ] ;
2021-08-11 11:54:51 +03:00
buildInputs = [ pythonWithPackages ] ;
# -n gives warnings on missing link targets, -W makes warnings into errors
2021-12-18 15:23:13 +03:00
buildPhase = '' c d d o c s ; s p h i n x - b u i l d - n - W . $o u t '' ;
2021-08-11 11:54:51 +03:00
dontInstall = true ;
} ;
Nix flake fix dev shells (#2655)
* nix: ghc92: ignore broken plugins
* nix: use current ghc for tools in the shell
Theses tools are pulled in the shell, but we don't need them to match
the GHC version used for development. Said otherwise, as long as we use
a working `cabal-install` to build with GHC 9.2, we don't care if that
cabal-install was built with GHC 8.10.
This gives more chance for theses tools to work and be in the binary
cache of nixpkgs.
* nix: disable shake-bench for ghc921
* nix: fix ghc 9.2 shell
* nix: explicit cabal project in devShell
Using alias, we get the "correct" behavior when typing `cabal build` in
the nix-shell, it points to the current cabal-project file.
* nix: remove special case for different ghc versions
* nix: move implicit-hie-cradle as a flake input
* nix: restore dev shell
This commit restores a working behavior for `nix-shell` or `nix
develop`, for all supported GHC versions.
When entering a `nix-shell`, or `nix develop
.#haskell-language-server-ghcXxX-dev` you will get an environment with
all the dependencies needed to run `cabal build`.
Haskell dependencies will be built by cabal instead of nix. This may be
more robust compared to a shell where dependencies are built by nix:
- It won't try to build any dependency with nix. This mean that it won't
benefit from nix caching, but on the other hand, it will perfectly
match the cabal plan.
- The nix shell may fail to start if an (possibly unneeded) dependency
was failing to build.
Entering nix-shell also generates an alias command `cabal_project` which
runs cabal with the correct project file if needed (e.g. for GHC 9.0 and
9.2). Users are notified with a message when entering the shell.
The old behavior (i.e. where dependencies are built with nix) is still
available with `nix develop .#haskell-language-server-xxx-dev-nix` (i.e.
suffix the name of the shell with `-nix`).
* nix: New entries which build all target at once
All HLS version can be built with `nix build
.#all-haskell-language-server`, and all development shells with `nix
build .#all-dev-shells`.
I had to workaround a limitation in `nix build` which is not able to
build multiples targets, instead I used linkFarmFromDrvs.
All packages and shells are now named with a unique package name
containing the GHC version.
* nix: Build all devShells and all binaries in CI
* nix: build HLS with dynamic linking
Related to #2668.
This fixs the build, however, because now HLS is dynamicly linked, it
pulls GHC as a dependency. The uncompressed closure size is now `~6GiB`.
* nix; fix CI command
* nix: only build dev shell with nix packages for current GHC version
* Another tentative to fix the build
* fix: Eval and alternate number format works with ghc 9.2
* fix CI build
* ANother tentative fix
2022-02-16 15:24:22 +03:00
mkDevShell = hpkgs : cabalProject : with pkgs ; mkShell {
name = " h a s k e l l - l a n g u a g e - s e r v e r - d e v - g h c ${ hpkgs . ghc . version } " ;
# For theses tools packages, we use ghcDefault
# This removes a rebuild with a different GHC version
# Theses programs are tools, used as binary, independently of the
# version of GHC.
# The drawback of this approach is that our shell may pull two GHC
# version in scope (the default one, and the one defined in
# `hpkgs`.)
# The advantage is that we won't have to rebuild theses tools (and
# dependencies) with a recent GHC which may not be supported by
# them.
buildInputs = [
# our compiling toolchain
hpkgs . ghc
pkgs . cabal-install
# @guibou: I'm not sure hie-bios is needed
ghcDefault . hie-bios
# Dependencies needed to build some parts of hackage
gmp zlib ncurses
# Changelog tooling
( gen-hls-changelogs ghcDefault )
# For the documentation
pythonWithPackages
# @guibou: I'm not sure this is needed.
hlint
ghcDefault . opentelemetry-extra
capstone tracy
# ormolu
# stylish-haskell
2022-05-13 12:09:51 +03:00
pre-commit
2022-07-11 03:23:00 +03:00
] ++ lib . optionals stdenv . isDarwin
( with darwin . apple_sdk . frameworks ; [
Cocoa
CoreServices
] ) ;
Nix flake fix dev shells (#2655)
* nix: ghc92: ignore broken plugins
* nix: use current ghc for tools in the shell
Theses tools are pulled in the shell, but we don't need them to match
the GHC version used for development. Said otherwise, as long as we use
a working `cabal-install` to build with GHC 9.2, we don't care if that
cabal-install was built with GHC 8.10.
This gives more chance for theses tools to work and be in the binary
cache of nixpkgs.
* nix: disable shake-bench for ghc921
* nix: fix ghc 9.2 shell
* nix: explicit cabal project in devShell
Using alias, we get the "correct" behavior when typing `cabal build` in
the nix-shell, it points to the current cabal-project file.
* nix: remove special case for different ghc versions
* nix: move implicit-hie-cradle as a flake input
* nix: restore dev shell
This commit restores a working behavior for `nix-shell` or `nix
develop`, for all supported GHC versions.
When entering a `nix-shell`, or `nix develop
.#haskell-language-server-ghcXxX-dev` you will get an environment with
all the dependencies needed to run `cabal build`.
Haskell dependencies will be built by cabal instead of nix. This may be
more robust compared to a shell where dependencies are built by nix:
- It won't try to build any dependency with nix. This mean that it won't
benefit from nix caching, but on the other hand, it will perfectly
match the cabal plan.
- The nix shell may fail to start if an (possibly unneeded) dependency
was failing to build.
Entering nix-shell also generates an alias command `cabal_project` which
runs cabal with the correct project file if needed (e.g. for GHC 9.0 and
9.2). Users are notified with a message when entering the shell.
The old behavior (i.e. where dependencies are built with nix) is still
available with `nix develop .#haskell-language-server-xxx-dev-nix` (i.e.
suffix the name of the shell with `-nix`).
* nix: New entries which build all target at once
All HLS version can be built with `nix build
.#all-haskell-language-server`, and all development shells with `nix
build .#all-dev-shells`.
I had to workaround a limitation in `nix build` which is not able to
build multiples targets, instead I used linkFarmFromDrvs.
All packages and shells are now named with a unique package name
containing the GHC version.
* nix: Build all devShells and all binaries in CI
* nix: build HLS with dynamic linking
Related to #2668.
This fixs the build, however, because now HLS is dynamicly linked, it
pulls GHC as a dependency. The uncompressed closure size is now `~6GiB`.
* nix; fix CI command
* nix: only build dev shell with nix packages for current GHC version
* Another tentative to fix the build
* fix: Eval and alternate number format works with ghc 9.2
* fix CI build
* ANother tentative fix
2022-02-16 15:24:22 +03:00
shellHook = ''
# @guibou: I'm not sure theses lines are needed
export LD_LIBRARY_PATH = $ { gmp } /lib : $ { zlib } /lib : $ { ncurses } /lib : $ { capstone } /lib
export DYLD_LIBRARY_PATH = $ { gmp } /lib : $ { zlib } /lib : $ { ncurses } /lib : $ { capstone } /lib
export PATH = $ PATH:$HOME/.local/bin
2022-06-28 11:54:32 +03:00
# Install pre-commit hook
pre-commit install
Nix flake fix dev shells (#2655)
* nix: ghc92: ignore broken plugins
* nix: use current ghc for tools in the shell
Theses tools are pulled in the shell, but we don't need them to match
the GHC version used for development. Said otherwise, as long as we use
a working `cabal-install` to build with GHC 9.2, we don't care if that
cabal-install was built with GHC 8.10.
This gives more chance for theses tools to work and be in the binary
cache of nixpkgs.
* nix: disable shake-bench for ghc921
* nix: fix ghc 9.2 shell
* nix: explicit cabal project in devShell
Using alias, we get the "correct" behavior when typing `cabal build` in
the nix-shell, it points to the current cabal-project file.
* nix: remove special case for different ghc versions
* nix: move implicit-hie-cradle as a flake input
* nix: restore dev shell
This commit restores a working behavior for `nix-shell` or `nix
develop`, for all supported GHC versions.
When entering a `nix-shell`, or `nix develop
.#haskell-language-server-ghcXxX-dev` you will get an environment with
all the dependencies needed to run `cabal build`.
Haskell dependencies will be built by cabal instead of nix. This may be
more robust compared to a shell where dependencies are built by nix:
- It won't try to build any dependency with nix. This mean that it won't
benefit from nix caching, but on the other hand, it will perfectly
match the cabal plan.
- The nix shell may fail to start if an (possibly unneeded) dependency
was failing to build.
Entering nix-shell also generates an alias command `cabal_project` which
runs cabal with the correct project file if needed (e.g. for GHC 9.0 and
9.2). Users are notified with a message when entering the shell.
The old behavior (i.e. where dependencies are built with nix) is still
available with `nix develop .#haskell-language-server-xxx-dev-nix` (i.e.
suffix the name of the shell with `-nix`).
* nix: New entries which build all target at once
All HLS version can be built with `nix build
.#all-haskell-language-server`, and all development shells with `nix
build .#all-dev-shells`.
I had to workaround a limitation in `nix build` which is not able to
build multiples targets, instead I used linkFarmFromDrvs.
All packages and shells are now named with a unique package name
containing the GHC version.
* nix: Build all devShells and all binaries in CI
* nix: build HLS with dynamic linking
Related to #2668.
This fixs the build, however, because now HLS is dynamicly linked, it
pulls GHC as a dependency. The uncompressed closure size is now `~6GiB`.
* nix; fix CI command
* nix: only build dev shell with nix packages for current GHC version
* Another tentative to fix the build
* fix: Eval and alternate number format works with ghc 9.2
* fix CI build
* ANother tentative fix
2022-02-16 15:24:22 +03:00
# If the cabal project file is not the default one.
# Print a warning and generate an alias.
if [ $ { cabalProject } != " c a b a l . p r o j e c t " ]
then
echo " C a b a l w o n ' t b e a b l e t o b u i l d y o u r p r o j e c t w i t h o u t u s i n g t h e p r o j e c t f i l e " $ { cabalProject } " , s u c h a s : "
echo " c a b a l - - p r o j e c t - f i l e = ${ cabalProject } "
echo " A n a l i a s " cabal_project " i s a v a i l a b l e . U s e i t l i k e : "
echo " c a b a l _ p r o j e c t b u i l d "
alias cabal_project = ' cabal - - project-file = $ { cabalProject } '
fi
'' ;
} ;
2021-05-19 10:32:23 +03:00
# Create a development shell of hls project
# See https://github.com/NixOS/nixpkgs/blob/5d4a430472cafada97888cc80672fab255231f57/pkgs/development/haskell-modules/make-package-set.nix#L319
Nix flake fix dev shells (#2655)
* nix: ghc92: ignore broken plugins
* nix: use current ghc for tools in the shell
Theses tools are pulled in the shell, but we don't need them to match
the GHC version used for development. Said otherwise, as long as we use
a working `cabal-install` to build with GHC 9.2, we don't care if that
cabal-install was built with GHC 8.10.
This gives more chance for theses tools to work and be in the binary
cache of nixpkgs.
* nix: disable shake-bench for ghc921
* nix: fix ghc 9.2 shell
* nix: explicit cabal project in devShell
Using alias, we get the "correct" behavior when typing `cabal build` in
the nix-shell, it points to the current cabal-project file.
* nix: remove special case for different ghc versions
* nix: move implicit-hie-cradle as a flake input
* nix: restore dev shell
This commit restores a working behavior for `nix-shell` or `nix
develop`, for all supported GHC versions.
When entering a `nix-shell`, or `nix develop
.#haskell-language-server-ghcXxX-dev` you will get an environment with
all the dependencies needed to run `cabal build`.
Haskell dependencies will be built by cabal instead of nix. This may be
more robust compared to a shell where dependencies are built by nix:
- It won't try to build any dependency with nix. This mean that it won't
benefit from nix caching, but on the other hand, it will perfectly
match the cabal plan.
- The nix shell may fail to start if an (possibly unneeded) dependency
was failing to build.
Entering nix-shell also generates an alias command `cabal_project` which
runs cabal with the correct project file if needed (e.g. for GHC 9.0 and
9.2). Users are notified with a message when entering the shell.
The old behavior (i.e. where dependencies are built with nix) is still
available with `nix develop .#haskell-language-server-xxx-dev-nix` (i.e.
suffix the name of the shell with `-nix`).
* nix: New entries which build all target at once
All HLS version can be built with `nix build
.#all-haskell-language-server`, and all development shells with `nix
build .#all-dev-shells`.
I had to workaround a limitation in `nix build` which is not able to
build multiples targets, instead I used linkFarmFromDrvs.
All packages and shells are now named with a unique package name
containing the GHC version.
* nix: Build all devShells and all binaries in CI
* nix: build HLS with dynamic linking
Related to #2668.
This fixs the build, however, because now HLS is dynamicly linked, it
pulls GHC as a dependency. The uncompressed closure size is now `~6GiB`.
* nix; fix CI command
* nix: only build dev shell with nix packages for current GHC version
* Another tentative to fix the build
* fix: Eval and alternate number format works with ghc 9.2
* fix CI build
* ANother tentative fix
2022-02-16 15:24:22 +03:00
mkDevShellWithNixDeps = hpkgs : cabalProject :
2021-05-19 10:32:23 +03:00
with pkgs ;
Nix flake fix dev shells (#2655)
* nix: ghc92: ignore broken plugins
* nix: use current ghc for tools in the shell
Theses tools are pulled in the shell, but we don't need them to match
the GHC version used for development. Said otherwise, as long as we use
a working `cabal-install` to build with GHC 9.2, we don't care if that
cabal-install was built with GHC 8.10.
This gives more chance for theses tools to work and be in the binary
cache of nixpkgs.
* nix: disable shake-bench for ghc921
* nix: fix ghc 9.2 shell
* nix: explicit cabal project in devShell
Using alias, we get the "correct" behavior when typing `cabal build` in
the nix-shell, it points to the current cabal-project file.
* nix: remove special case for different ghc versions
* nix: move implicit-hie-cradle as a flake input
* nix: restore dev shell
This commit restores a working behavior for `nix-shell` or `nix
develop`, for all supported GHC versions.
When entering a `nix-shell`, or `nix develop
.#haskell-language-server-ghcXxX-dev` you will get an environment with
all the dependencies needed to run `cabal build`.
Haskell dependencies will be built by cabal instead of nix. This may be
more robust compared to a shell where dependencies are built by nix:
- It won't try to build any dependency with nix. This mean that it won't
benefit from nix caching, but on the other hand, it will perfectly
match the cabal plan.
- The nix shell may fail to start if an (possibly unneeded) dependency
was failing to build.
Entering nix-shell also generates an alias command `cabal_project` which
runs cabal with the correct project file if needed (e.g. for GHC 9.0 and
9.2). Users are notified with a message when entering the shell.
The old behavior (i.e. where dependencies are built with nix) is still
available with `nix develop .#haskell-language-server-xxx-dev-nix` (i.e.
suffix the name of the shell with `-nix`).
* nix: New entries which build all target at once
All HLS version can be built with `nix build
.#all-haskell-language-server`, and all development shells with `nix
build .#all-dev-shells`.
I had to workaround a limitation in `nix build` which is not able to
build multiples targets, instead I used linkFarmFromDrvs.
All packages and shells are now named with a unique package name
containing the GHC version.
* nix: Build all devShells and all binaries in CI
* nix: build HLS with dynamic linking
Related to #2668.
This fixs the build, however, because now HLS is dynamicly linked, it
pulls GHC as a dependency. The uncompressed closure size is now `~6GiB`.
* nix; fix CI command
* nix: only build dev shell with nix packages for current GHC version
* Another tentative to fix the build
* fix: Eval and alternate number format works with ghc 9.2
* fix CI build
* ANother tentative fix
2022-02-16 15:24:22 +03:00
let simpleShell = mkDevShell hpkgs cabalProject ;
in
2021-05-19 10:32:23 +03:00
hpkgs . shellFor {
Nix flake fix dev shells (#2655)
* nix: ghc92: ignore broken plugins
* nix: use current ghc for tools in the shell
Theses tools are pulled in the shell, but we don't need them to match
the GHC version used for development. Said otherwise, as long as we use
a working `cabal-install` to build with GHC 9.2, we don't care if that
cabal-install was built with GHC 8.10.
This gives more chance for theses tools to work and be in the binary
cache of nixpkgs.
* nix: disable shake-bench for ghc921
* nix: fix ghc 9.2 shell
* nix: explicit cabal project in devShell
Using alias, we get the "correct" behavior when typing `cabal build` in
the nix-shell, it points to the current cabal-project file.
* nix: remove special case for different ghc versions
* nix: move implicit-hie-cradle as a flake input
* nix: restore dev shell
This commit restores a working behavior for `nix-shell` or `nix
develop`, for all supported GHC versions.
When entering a `nix-shell`, or `nix develop
.#haskell-language-server-ghcXxX-dev` you will get an environment with
all the dependencies needed to run `cabal build`.
Haskell dependencies will be built by cabal instead of nix. This may be
more robust compared to a shell where dependencies are built by nix:
- It won't try to build any dependency with nix. This mean that it won't
benefit from nix caching, but on the other hand, it will perfectly
match the cabal plan.
- The nix shell may fail to start if an (possibly unneeded) dependency
was failing to build.
Entering nix-shell also generates an alias command `cabal_project` which
runs cabal with the correct project file if needed (e.g. for GHC 9.0 and
9.2). Users are notified with a message when entering the shell.
The old behavior (i.e. where dependencies are built with nix) is still
available with `nix develop .#haskell-language-server-xxx-dev-nix` (i.e.
suffix the name of the shell with `-nix`).
* nix: New entries which build all target at once
All HLS version can be built with `nix build
.#all-haskell-language-server`, and all development shells with `nix
build .#all-dev-shells`.
I had to workaround a limitation in `nix build` which is not able to
build multiples targets, instead I used linkFarmFromDrvs.
All packages and shells are now named with a unique package name
containing the GHC version.
* nix: Build all devShells and all binaries in CI
* nix: build HLS with dynamic linking
Related to #2668.
This fixs the build, however, because now HLS is dynamicly linked, it
pulls GHC as a dependency. The uncompressed closure size is now `~6GiB`.
* nix; fix CI command
* nix: only build dev shell with nix packages for current GHC version
* Another tentative to fix the build
* fix: Eval and alternate number format works with ghc 9.2
* fix CI build
* ANother tentative fix
2022-02-16 15:24:22 +03:00
name = " h a s k e l l - l a n g u a g e - s e r v e r - d e v - n i x - g h c ${ hpkgs . ghc . version } " ;
inherit ( simpleShell ) shellHook buildInputs ;
2021-05-19 10:32:23 +03:00
doBenchmark = true ;
packages = p :
with builtins ;
2021-07-04 08:15:04 +03:00
map ( name : p . ${ name } ) ( attrNames
Nix flake fix dev shells (#2655)
* nix: ghc92: ignore broken plugins
* nix: use current ghc for tools in the shell
Theses tools are pulled in the shell, but we don't need them to match
the GHC version used for development. Said otherwise, as long as we use
a working `cabal-install` to build with GHC 9.2, we don't care if that
cabal-install was built with GHC 8.10.
This gives more chance for theses tools to work and be in the binary
cache of nixpkgs.
* nix: disable shake-bench for ghc921
* nix: fix ghc 9.2 shell
* nix: explicit cabal project in devShell
Using alias, we get the "correct" behavior when typing `cabal build` in
the nix-shell, it points to the current cabal-project file.
* nix: remove special case for different ghc versions
* nix: move implicit-hie-cradle as a flake input
* nix: restore dev shell
This commit restores a working behavior for `nix-shell` or `nix
develop`, for all supported GHC versions.
When entering a `nix-shell`, or `nix develop
.#haskell-language-server-ghcXxX-dev` you will get an environment with
all the dependencies needed to run `cabal build`.
Haskell dependencies will be built by cabal instead of nix. This may be
more robust compared to a shell where dependencies are built by nix:
- It won't try to build any dependency with nix. This mean that it won't
benefit from nix caching, but on the other hand, it will perfectly
match the cabal plan.
- The nix shell may fail to start if an (possibly unneeded) dependency
was failing to build.
Entering nix-shell also generates an alias command `cabal_project` which
runs cabal with the correct project file if needed (e.g. for GHC 9.0 and
9.2). Users are notified with a message when entering the shell.
The old behavior (i.e. where dependencies are built with nix) is still
available with `nix develop .#haskell-language-server-xxx-dev-nix` (i.e.
suffix the name of the shell with `-nix`).
* nix: New entries which build all target at once
All HLS version can be built with `nix build
.#all-haskell-language-server`, and all development shells with `nix
build .#all-dev-shells`.
I had to workaround a limitation in `nix build` which is not able to
build multiples targets, instead I used linkFarmFromDrvs.
All packages and shells are now named with a unique package name
containing the GHC version.
* nix: Build all devShells and all binaries in CI
* nix: build HLS with dynamic linking
Related to #2668.
This fixs the build, however, because now HLS is dynamicly linked, it
pulls GHC as a dependency. The uncompressed closure size is now `~6GiB`.
* nix; fix CI command
* nix: only build dev shell with nix packages for current GHC version
* Another tentative to fix the build
* fix: Eval and alternate number format works with ghc 9.2
* fix CI build
* ANother tentative fix
2022-02-16 15:24:22 +03:00
# Disable dependencies should not be part of the shell.
( removeAttrs hlsSources ( hpkgs . hlsDisabledPlugins or [ ] ) ) ) ;
2021-05-19 10:32:23 +03:00
src = null ;
} ;
# Create a hls executable
# Copied from https://github.com/NixOS/nixpkgs/blob/210784b7c8f3d926b7db73bdad085f4dc5d79418/pkgs/development/tools/haskell/haskell-language-server/withWrapper.nix#L16
mkExe = hpkgs :
with pkgs . haskell . lib ;
Nix flake fix dev shells (#2655)
* nix: ghc92: ignore broken plugins
* nix: use current ghc for tools in the shell
Theses tools are pulled in the shell, but we don't need them to match
the GHC version used for development. Said otherwise, as long as we use
a working `cabal-install` to build with GHC 9.2, we don't care if that
cabal-install was built with GHC 8.10.
This gives more chance for theses tools to work and be in the binary
cache of nixpkgs.
* nix: disable shake-bench for ghc921
* nix: fix ghc 9.2 shell
* nix: explicit cabal project in devShell
Using alias, we get the "correct" behavior when typing `cabal build` in
the nix-shell, it points to the current cabal-project file.
* nix: remove special case for different ghc versions
* nix: move implicit-hie-cradle as a flake input
* nix: restore dev shell
This commit restores a working behavior for `nix-shell` or `nix
develop`, for all supported GHC versions.
When entering a `nix-shell`, or `nix develop
.#haskell-language-server-ghcXxX-dev` you will get an environment with
all the dependencies needed to run `cabal build`.
Haskell dependencies will be built by cabal instead of nix. This may be
more robust compared to a shell where dependencies are built by nix:
- It won't try to build any dependency with nix. This mean that it won't
benefit from nix caching, but on the other hand, it will perfectly
match the cabal plan.
- The nix shell may fail to start if an (possibly unneeded) dependency
was failing to build.
Entering nix-shell also generates an alias command `cabal_project` which
runs cabal with the correct project file if needed (e.g. for GHC 9.0 and
9.2). Users are notified with a message when entering the shell.
The old behavior (i.e. where dependencies are built with nix) is still
available with `nix develop .#haskell-language-server-xxx-dev-nix` (i.e.
suffix the name of the shell with `-nix`).
* nix: New entries which build all target at once
All HLS version can be built with `nix build
.#all-haskell-language-server`, and all development shells with `nix
build .#all-dev-shells`.
I had to workaround a limitation in `nix build` which is not able to
build multiples targets, instead I used linkFarmFromDrvs.
All packages and shells are now named with a unique package name
containing the GHC version.
* nix: Build all devShells and all binaries in CI
* nix: build HLS with dynamic linking
Related to #2668.
This fixs the build, however, because now HLS is dynamicly linked, it
pulls GHC as a dependency. The uncompressed closure size is now `~6GiB`.
* nix; fix CI command
* nix: only build dev shell with nix packages for current GHC version
* Another tentative to fix the build
* fix: Eval and alternate number format works with ghc 9.2
* fix CI build
* ANother tentative fix
2022-02-16 15:24:22 +03:00
( enableSharedExecutables ( overrideCabal hpkgs . haskell-language-server
2021-05-19 10:32:23 +03:00
( _ : {
postInstall = ''
remove-references-to - t $ { hpkgs . shake . data } $ out/bin/haskell-language-server
remove-references-to - t $ { hpkgs . js-jquery . data } $ out/bin/haskell-language-server
remove-references-to - t $ { hpkgs . js-dgtable . data } $ out/bin/haskell-language-server
remove-references-to - t $ { hpkgs . js-flot . data } $ out/bin/haskell-language-server
'' ;
Nix flake fix dev shells (#2655)
* nix: ghc92: ignore broken plugins
* nix: use current ghc for tools in the shell
Theses tools are pulled in the shell, but we don't need them to match
the GHC version used for development. Said otherwise, as long as we use
a working `cabal-install` to build with GHC 9.2, we don't care if that
cabal-install was built with GHC 8.10.
This gives more chance for theses tools to work and be in the binary
cache of nixpkgs.
* nix: disable shake-bench for ghc921
* nix: fix ghc 9.2 shell
* nix: explicit cabal project in devShell
Using alias, we get the "correct" behavior when typing `cabal build` in
the nix-shell, it points to the current cabal-project file.
* nix: remove special case for different ghc versions
* nix: move implicit-hie-cradle as a flake input
* nix: restore dev shell
This commit restores a working behavior for `nix-shell` or `nix
develop`, for all supported GHC versions.
When entering a `nix-shell`, or `nix develop
.#haskell-language-server-ghcXxX-dev` you will get an environment with
all the dependencies needed to run `cabal build`.
Haskell dependencies will be built by cabal instead of nix. This may be
more robust compared to a shell where dependencies are built by nix:
- It won't try to build any dependency with nix. This mean that it won't
benefit from nix caching, but on the other hand, it will perfectly
match the cabal plan.
- The nix shell may fail to start if an (possibly unneeded) dependency
was failing to build.
Entering nix-shell also generates an alias command `cabal_project` which
runs cabal with the correct project file if needed (e.g. for GHC 9.0 and
9.2). Users are notified with a message when entering the shell.
The old behavior (i.e. where dependencies are built with nix) is still
available with `nix develop .#haskell-language-server-xxx-dev-nix` (i.e.
suffix the name of the shell with `-nix`).
* nix: New entries which build all target at once
All HLS version can be built with `nix build
.#all-haskell-language-server`, and all development shells with `nix
build .#all-dev-shells`.
I had to workaround a limitation in `nix build` which is not able to
build multiples targets, instead I used linkFarmFromDrvs.
All packages and shells are now named with a unique package name
containing the GHC version.
* nix: Build all devShells and all binaries in CI
* nix: build HLS with dynamic linking
Related to #2668.
This fixs the build, however, because now HLS is dynamicly linked, it
pulls GHC as a dependency. The uncompressed closure size is now `~6GiB`.
* nix; fix CI command
* nix: only build dev shell with nix packages for current GHC version
* Another tentative to fix the build
* fix: Eval and alternate number format works with ghc 9.2
* fix CI build
* ANother tentative fix
2022-02-16 15:24:22 +03:00
} ) ) ) . overrideAttrs ( old : {
pname = old . pname + " - g h c ${ hpkgs . ghc . version } " ;
} ) ;
2021-05-19 10:32:23 +03:00
in with pkgs ; rec {
Nix flake fix dev shells (#2655)
* nix: ghc92: ignore broken plugins
* nix: use current ghc for tools in the shell
Theses tools are pulled in the shell, but we don't need them to match
the GHC version used for development. Said otherwise, as long as we use
a working `cabal-install` to build with GHC 9.2, we don't care if that
cabal-install was built with GHC 8.10.
This gives more chance for theses tools to work and be in the binary
cache of nixpkgs.
* nix: disable shake-bench for ghc921
* nix: fix ghc 9.2 shell
* nix: explicit cabal project in devShell
Using alias, we get the "correct" behavior when typing `cabal build` in
the nix-shell, it points to the current cabal-project file.
* nix: remove special case for different ghc versions
* nix: move implicit-hie-cradle as a flake input
* nix: restore dev shell
This commit restores a working behavior for `nix-shell` or `nix
develop`, for all supported GHC versions.
When entering a `nix-shell`, or `nix develop
.#haskell-language-server-ghcXxX-dev` you will get an environment with
all the dependencies needed to run `cabal build`.
Haskell dependencies will be built by cabal instead of nix. This may be
more robust compared to a shell where dependencies are built by nix:
- It won't try to build any dependency with nix. This mean that it won't
benefit from nix caching, but on the other hand, it will perfectly
match the cabal plan.
- The nix shell may fail to start if an (possibly unneeded) dependency
was failing to build.
Entering nix-shell also generates an alias command `cabal_project` which
runs cabal with the correct project file if needed (e.g. for GHC 9.0 and
9.2). Users are notified with a message when entering the shell.
The old behavior (i.e. where dependencies are built with nix) is still
available with `nix develop .#haskell-language-server-xxx-dev-nix` (i.e.
suffix the name of the shell with `-nix`).
* nix: New entries which build all target at once
All HLS version can be built with `nix build
.#all-haskell-language-server`, and all development shells with `nix
build .#all-dev-shells`.
I had to workaround a limitation in `nix build` which is not able to
build multiples targets, instead I used linkFarmFromDrvs.
All packages and shells are now named with a unique package name
containing the GHC version.
* nix: Build all devShells and all binaries in CI
* nix: build HLS with dynamic linking
Related to #2668.
This fixs the build, however, because now HLS is dynamicly linked, it
pulls GHC as a dependency. The uncompressed closure size is now `~6GiB`.
* nix; fix CI command
* nix: only build dev shell with nix packages for current GHC version
* Another tentative to fix the build
* fix: Eval and alternate number format works with ghc 9.2
* fix CI build
* ANother tentative fix
2022-02-16 15:24:22 +03:00
# Developement shell with only compiler
simpleDevShells = {
haskell-language-server-dev = mkDevShell ghcDefault " c a b a l . p r o j e c t " ;
2022-05-13 12:09:51 +03:00
haskell-language-server-902-dev = mkDevShell ghc902 " c a b a l . p r o j e c t " ;
haskell-language-server-922-dev = mkDevShell ghc922 " c a b a l . p r o j e c t " ;
Nix flake fix dev shells (#2655)
* nix: ghc92: ignore broken plugins
* nix: use current ghc for tools in the shell
Theses tools are pulled in the shell, but we don't need them to match
the GHC version used for development. Said otherwise, as long as we use
a working `cabal-install` to build with GHC 9.2, we don't care if that
cabal-install was built with GHC 8.10.
This gives more chance for theses tools to work and be in the binary
cache of nixpkgs.
* nix: disable shake-bench for ghc921
* nix: fix ghc 9.2 shell
* nix: explicit cabal project in devShell
Using alias, we get the "correct" behavior when typing `cabal build` in
the nix-shell, it points to the current cabal-project file.
* nix: remove special case for different ghc versions
* nix: move implicit-hie-cradle as a flake input
* nix: restore dev shell
This commit restores a working behavior for `nix-shell` or `nix
develop`, for all supported GHC versions.
When entering a `nix-shell`, or `nix develop
.#haskell-language-server-ghcXxX-dev` you will get an environment with
all the dependencies needed to run `cabal build`.
Haskell dependencies will be built by cabal instead of nix. This may be
more robust compared to a shell where dependencies are built by nix:
- It won't try to build any dependency with nix. This mean that it won't
benefit from nix caching, but on the other hand, it will perfectly
match the cabal plan.
- The nix shell may fail to start if an (possibly unneeded) dependency
was failing to build.
Entering nix-shell also generates an alias command `cabal_project` which
runs cabal with the correct project file if needed (e.g. for GHC 9.0 and
9.2). Users are notified with a message when entering the shell.
The old behavior (i.e. where dependencies are built with nix) is still
available with `nix develop .#haskell-language-server-xxx-dev-nix` (i.e.
suffix the name of the shell with `-nix`).
* nix: New entries which build all target at once
All HLS version can be built with `nix build
.#all-haskell-language-server`, and all development shells with `nix
build .#all-dev-shells`.
I had to workaround a limitation in `nix build` which is not able to
build multiples targets, instead I used linkFarmFromDrvs.
All packages and shells are now named with a unique package name
containing the GHC version.
* nix: Build all devShells and all binaries in CI
* nix: build HLS with dynamic linking
Related to #2668.
This fixs the build, however, because now HLS is dynamicly linked, it
pulls GHC as a dependency. The uncompressed closure size is now `~6GiB`.
* nix; fix CI command
* nix: only build dev shell with nix packages for current GHC version
* Another tentative to fix the build
* fix: Eval and alternate number format works with ghc 9.2
* fix CI build
* ANother tentative fix
2022-02-16 15:24:22 +03:00
} ;
2021-05-19 10:32:23 +03:00
Nix flake fix dev shells (#2655)
* nix: ghc92: ignore broken plugins
* nix: use current ghc for tools in the shell
Theses tools are pulled in the shell, but we don't need them to match
the GHC version used for development. Said otherwise, as long as we use
a working `cabal-install` to build with GHC 9.2, we don't care if that
cabal-install was built with GHC 8.10.
This gives more chance for theses tools to work and be in the binary
cache of nixpkgs.
* nix: disable shake-bench for ghc921
* nix: fix ghc 9.2 shell
* nix: explicit cabal project in devShell
Using alias, we get the "correct" behavior when typing `cabal build` in
the nix-shell, it points to the current cabal-project file.
* nix: remove special case for different ghc versions
* nix: move implicit-hie-cradle as a flake input
* nix: restore dev shell
This commit restores a working behavior for `nix-shell` or `nix
develop`, for all supported GHC versions.
When entering a `nix-shell`, or `nix develop
.#haskell-language-server-ghcXxX-dev` you will get an environment with
all the dependencies needed to run `cabal build`.
Haskell dependencies will be built by cabal instead of nix. This may be
more robust compared to a shell where dependencies are built by nix:
- It won't try to build any dependency with nix. This mean that it won't
benefit from nix caching, but on the other hand, it will perfectly
match the cabal plan.
- The nix shell may fail to start if an (possibly unneeded) dependency
was failing to build.
Entering nix-shell also generates an alias command `cabal_project` which
runs cabal with the correct project file if needed (e.g. for GHC 9.0 and
9.2). Users are notified with a message when entering the shell.
The old behavior (i.e. where dependencies are built with nix) is still
available with `nix develop .#haskell-language-server-xxx-dev-nix` (i.e.
suffix the name of the shell with `-nix`).
* nix: New entries which build all target at once
All HLS version can be built with `nix build
.#all-haskell-language-server`, and all development shells with `nix
build .#all-dev-shells`.
I had to workaround a limitation in `nix build` which is not able to
build multiples targets, instead I used linkFarmFromDrvs.
All packages and shells are now named with a unique package name
containing the GHC version.
* nix: Build all devShells and all binaries in CI
* nix: build HLS with dynamic linking
Related to #2668.
This fixs the build, however, because now HLS is dynamicly linked, it
pulls GHC as a dependency. The uncompressed closure size is now `~6GiB`.
* nix; fix CI command
* nix: only build dev shell with nix packages for current GHC version
* Another tentative to fix the build
* fix: Eval and alternate number format works with ghc 9.2
* fix CI build
* ANother tentative fix
2022-02-16 15:24:22 +03:00
# Developement shell, haskell packages are also provided by nix
nixDevShells = {
haskell-language-server-dev-nix = mkDevShellWithNixDeps ghcDefault " c a b a l . p r o j e c t " ;
2022-05-13 12:09:51 +03:00
haskell-language-server-902-dev-nix = mkDevShellWithNixDeps ghc902 " c a b a l . p r o j e c t " ;
haskell-language-server-922-dev-nix = mkDevShellWithNixDeps ghc922 " c a b a l . p r o j e c t " ;
Nix flake fix dev shells (#2655)
* nix: ghc92: ignore broken plugins
* nix: use current ghc for tools in the shell
Theses tools are pulled in the shell, but we don't need them to match
the GHC version used for development. Said otherwise, as long as we use
a working `cabal-install` to build with GHC 9.2, we don't care if that
cabal-install was built with GHC 8.10.
This gives more chance for theses tools to work and be in the binary
cache of nixpkgs.
* nix: disable shake-bench for ghc921
* nix: fix ghc 9.2 shell
* nix: explicit cabal project in devShell
Using alias, we get the "correct" behavior when typing `cabal build` in
the nix-shell, it points to the current cabal-project file.
* nix: remove special case for different ghc versions
* nix: move implicit-hie-cradle as a flake input
* nix: restore dev shell
This commit restores a working behavior for `nix-shell` or `nix
develop`, for all supported GHC versions.
When entering a `nix-shell`, or `nix develop
.#haskell-language-server-ghcXxX-dev` you will get an environment with
all the dependencies needed to run `cabal build`.
Haskell dependencies will be built by cabal instead of nix. This may be
more robust compared to a shell where dependencies are built by nix:
- It won't try to build any dependency with nix. This mean that it won't
benefit from nix caching, but on the other hand, it will perfectly
match the cabal plan.
- The nix shell may fail to start if an (possibly unneeded) dependency
was failing to build.
Entering nix-shell also generates an alias command `cabal_project` which
runs cabal with the correct project file if needed (e.g. for GHC 9.0 and
9.2). Users are notified with a message when entering the shell.
The old behavior (i.e. where dependencies are built with nix) is still
available with `nix develop .#haskell-language-server-xxx-dev-nix` (i.e.
suffix the name of the shell with `-nix`).
* nix: New entries which build all target at once
All HLS version can be built with `nix build
.#all-haskell-language-server`, and all development shells with `nix
build .#all-dev-shells`.
I had to workaround a limitation in `nix build` which is not able to
build multiples targets, instead I used linkFarmFromDrvs.
All packages and shells are now named with a unique package name
containing the GHC version.
* nix: Build all devShells and all binaries in CI
* nix: build HLS with dynamic linking
Related to #2668.
This fixs the build, however, because now HLS is dynamicly linked, it
pulls GHC as a dependency. The uncompressed closure size is now `~6GiB`.
* nix; fix CI command
* nix: only build dev shell with nix packages for current GHC version
* Another tentative to fix the build
* fix: Eval and alternate number format works with ghc 9.2
* fix CI build
* ANother tentative fix
2022-02-16 15:24:22 +03:00
} ;
2021-05-19 10:32:23 +03:00
Nix flake fix dev shells (#2655)
* nix: ghc92: ignore broken plugins
* nix: use current ghc for tools in the shell
Theses tools are pulled in the shell, but we don't need them to match
the GHC version used for development. Said otherwise, as long as we use
a working `cabal-install` to build with GHC 9.2, we don't care if that
cabal-install was built with GHC 8.10.
This gives more chance for theses tools to work and be in the binary
cache of nixpkgs.
* nix: disable shake-bench for ghc921
* nix: fix ghc 9.2 shell
* nix: explicit cabal project in devShell
Using alias, we get the "correct" behavior when typing `cabal build` in
the nix-shell, it points to the current cabal-project file.
* nix: remove special case for different ghc versions
* nix: move implicit-hie-cradle as a flake input
* nix: restore dev shell
This commit restores a working behavior for `nix-shell` or `nix
develop`, for all supported GHC versions.
When entering a `nix-shell`, or `nix develop
.#haskell-language-server-ghcXxX-dev` you will get an environment with
all the dependencies needed to run `cabal build`.
Haskell dependencies will be built by cabal instead of nix. This may be
more robust compared to a shell where dependencies are built by nix:
- It won't try to build any dependency with nix. This mean that it won't
benefit from nix caching, but on the other hand, it will perfectly
match the cabal plan.
- The nix shell may fail to start if an (possibly unneeded) dependency
was failing to build.
Entering nix-shell also generates an alias command `cabal_project` which
runs cabal with the correct project file if needed (e.g. for GHC 9.0 and
9.2). Users are notified with a message when entering the shell.
The old behavior (i.e. where dependencies are built with nix) is still
available with `nix develop .#haskell-language-server-xxx-dev-nix` (i.e.
suffix the name of the shell with `-nix`).
* nix: New entries which build all target at once
All HLS version can be built with `nix build
.#all-haskell-language-server`, and all development shells with `nix
build .#all-dev-shells`.
I had to workaround a limitation in `nix build` which is not able to
build multiples targets, instead I used linkFarmFromDrvs.
All packages and shells are now named with a unique package name
containing the GHC version.
* nix: Build all devShells and all binaries in CI
* nix: build HLS with dynamic linking
Related to #2668.
This fixs the build, however, because now HLS is dynamicly linked, it
pulls GHC as a dependency. The uncompressed closure size is now `~6GiB`.
* nix; fix CI command
* nix: only build dev shell with nix packages for current GHC version
* Another tentative to fix the build
* fix: Eval and alternate number format works with ghc 9.2
* fix CI build
* ANother tentative fix
2022-02-16 15:24:22 +03:00
allPackages = {
2021-05-19 10:32:23 +03:00
haskell-language-server = mkExe ghcDefault ;
2022-05-13 12:09:51 +03:00
haskell-language-server-902 = mkExe ghc902 ;
haskell-language-server-922 = mkExe ghc922 ;
Nix flake fix dev shells (#2655)
* nix: ghc92: ignore broken plugins
* nix: use current ghc for tools in the shell
Theses tools are pulled in the shell, but we don't need them to match
the GHC version used for development. Said otherwise, as long as we use
a working `cabal-install` to build with GHC 9.2, we don't care if that
cabal-install was built with GHC 8.10.
This gives more chance for theses tools to work and be in the binary
cache of nixpkgs.
* nix: disable shake-bench for ghc921
* nix: fix ghc 9.2 shell
* nix: explicit cabal project in devShell
Using alias, we get the "correct" behavior when typing `cabal build` in
the nix-shell, it points to the current cabal-project file.
* nix: remove special case for different ghc versions
* nix: move implicit-hie-cradle as a flake input
* nix: restore dev shell
This commit restores a working behavior for `nix-shell` or `nix
develop`, for all supported GHC versions.
When entering a `nix-shell`, or `nix develop
.#haskell-language-server-ghcXxX-dev` you will get an environment with
all the dependencies needed to run `cabal build`.
Haskell dependencies will be built by cabal instead of nix. This may be
more robust compared to a shell where dependencies are built by nix:
- It won't try to build any dependency with nix. This mean that it won't
benefit from nix caching, but on the other hand, it will perfectly
match the cabal plan.
- The nix shell may fail to start if an (possibly unneeded) dependency
was failing to build.
Entering nix-shell also generates an alias command `cabal_project` which
runs cabal with the correct project file if needed (e.g. for GHC 9.0 and
9.2). Users are notified with a message when entering the shell.
The old behavior (i.e. where dependencies are built with nix) is still
available with `nix develop .#haskell-language-server-xxx-dev-nix` (i.e.
suffix the name of the shell with `-nix`).
* nix: New entries which build all target at once
All HLS version can be built with `nix build
.#all-haskell-language-server`, and all development shells with `nix
build .#all-dev-shells`.
I had to workaround a limitation in `nix build` which is not able to
build multiples targets, instead I used linkFarmFromDrvs.
All packages and shells are now named with a unique package name
containing the GHC version.
* nix: Build all devShells and all binaries in CI
* nix: build HLS with dynamic linking
Related to #2668.
This fixs the build, however, because now HLS is dynamicly linked, it
pulls GHC as a dependency. The uncompressed closure size is now `~6GiB`.
* nix; fix CI command
* nix: only build dev shell with nix packages for current GHC version
* Another tentative to fix the build
* fix: Eval and alternate number format works with ghc 9.2
* fix CI build
* ANother tentative fix
2022-02-16 15:24:22 +03:00
} ;
2022-05-13 12:09:51 +03:00
devShells = simpleDevShells // nixDevShells // {
default = simpleDevShells . haskell-language-server-dev ;
} ;
Nix flake fix dev shells (#2655)
* nix: ghc92: ignore broken plugins
* nix: use current ghc for tools in the shell
Theses tools are pulled in the shell, but we don't need them to match
the GHC version used for development. Said otherwise, as long as we use
a working `cabal-install` to build with GHC 9.2, we don't care if that
cabal-install was built with GHC 8.10.
This gives more chance for theses tools to work and be in the binary
cache of nixpkgs.
* nix: disable shake-bench for ghc921
* nix: fix ghc 9.2 shell
* nix: explicit cabal project in devShell
Using alias, we get the "correct" behavior when typing `cabal build` in
the nix-shell, it points to the current cabal-project file.
* nix: remove special case for different ghc versions
* nix: move implicit-hie-cradle as a flake input
* nix: restore dev shell
This commit restores a working behavior for `nix-shell` or `nix
develop`, for all supported GHC versions.
When entering a `nix-shell`, or `nix develop
.#haskell-language-server-ghcXxX-dev` you will get an environment with
all the dependencies needed to run `cabal build`.
Haskell dependencies will be built by cabal instead of nix. This may be
more robust compared to a shell where dependencies are built by nix:
- It won't try to build any dependency with nix. This mean that it won't
benefit from nix caching, but on the other hand, it will perfectly
match the cabal plan.
- The nix shell may fail to start if an (possibly unneeded) dependency
was failing to build.
Entering nix-shell also generates an alias command `cabal_project` which
runs cabal with the correct project file if needed (e.g. for GHC 9.0 and
9.2). Users are notified with a message when entering the shell.
The old behavior (i.e. where dependencies are built with nix) is still
available with `nix develop .#haskell-language-server-xxx-dev-nix` (i.e.
suffix the name of the shell with `-nix`).
* nix: New entries which build all target at once
All HLS version can be built with `nix build
.#all-haskell-language-server`, and all development shells with `nix
build .#all-dev-shells`.
I had to workaround a limitation in `nix build` which is not able to
build multiples targets, instead I used linkFarmFromDrvs.
All packages and shells are now named with a unique package name
containing the GHC version.
* nix: Build all devShells and all binaries in CI
* nix: build HLS with dynamic linking
Related to #2668.
This fixs the build, however, because now HLS is dynamicly linked, it
pulls GHC as a dependency. The uncompressed closure size is now `~6GiB`.
* nix; fix CI command
* nix: only build dev shell with nix packages for current GHC version
* Another tentative to fix the build
* fix: Eval and alternate number format works with ghc 9.2
* fix CI build
* ANother tentative fix
2022-02-16 15:24:22 +03:00
packages = allPackages // {
2022-05-13 12:09:51 +03:00
default = allPackages . haskell-language-server ;
Nix flake fix dev shells (#2655)
* nix: ghc92: ignore broken plugins
* nix: use current ghc for tools in the shell
Theses tools are pulled in the shell, but we don't need them to match
the GHC version used for development. Said otherwise, as long as we use
a working `cabal-install` to build with GHC 9.2, we don't care if that
cabal-install was built with GHC 8.10.
This gives more chance for theses tools to work and be in the binary
cache of nixpkgs.
* nix: disable shake-bench for ghc921
* nix: fix ghc 9.2 shell
* nix: explicit cabal project in devShell
Using alias, we get the "correct" behavior when typing `cabal build` in
the nix-shell, it points to the current cabal-project file.
* nix: remove special case for different ghc versions
* nix: move implicit-hie-cradle as a flake input
* nix: restore dev shell
This commit restores a working behavior for `nix-shell` or `nix
develop`, for all supported GHC versions.
When entering a `nix-shell`, or `nix develop
.#haskell-language-server-ghcXxX-dev` you will get an environment with
all the dependencies needed to run `cabal build`.
Haskell dependencies will be built by cabal instead of nix. This may be
more robust compared to a shell where dependencies are built by nix:
- It won't try to build any dependency with nix. This mean that it won't
benefit from nix caching, but on the other hand, it will perfectly
match the cabal plan.
- The nix shell may fail to start if an (possibly unneeded) dependency
was failing to build.
Entering nix-shell also generates an alias command `cabal_project` which
runs cabal with the correct project file if needed (e.g. for GHC 9.0 and
9.2). Users are notified with a message when entering the shell.
The old behavior (i.e. where dependencies are built with nix) is still
available with `nix develop .#haskell-language-server-xxx-dev-nix` (i.e.
suffix the name of the shell with `-nix`).
* nix: New entries which build all target at once
All HLS version can be built with `nix build
.#all-haskell-language-server`, and all development shells with `nix
build .#all-dev-shells`.
I had to workaround a limitation in `nix build` which is not able to
build multiples targets, instead I used linkFarmFromDrvs.
All packages and shells are now named with a unique package name
containing the GHC version.
* nix: Build all devShells and all binaries in CI
* nix: build HLS with dynamic linking
Related to #2668.
This fixs the build, however, because now HLS is dynamicly linked, it
pulls GHC as a dependency. The uncompressed closure size is now `~6GiB`.
* nix; fix CI command
* nix: only build dev shell with nix packages for current GHC version
* Another tentative to fix the build
* fix: Eval and alternate number format works with ghc 9.2
* fix CI build
* ANother tentative fix
2022-02-16 15:24:22 +03:00
# See https://github.com/NixOS/nix/issues/5591
# nix flake cannot build a list/set of derivation in one command.
# Using a linkFarmFromDrvs, I'm creating a unique entry point to
# build all HLS versions.
# This is used in CI to test and populate cache for packages
# distributed using nix.
all-haskell-language-server = linkFarmFromDrvs " a l l - h a s k e l l - l a n g u a g e - s e r v e r " ( lib . unique ( builtins . attrValues allPackages ) ) ;
2022-02-27 17:21:20 +03:00
# Same for all shells
Nix flake fix dev shells (#2655)
* nix: ghc92: ignore broken plugins
* nix: use current ghc for tools in the shell
Theses tools are pulled in the shell, but we don't need them to match
the GHC version used for development. Said otherwise, as long as we use
a working `cabal-install` to build with GHC 9.2, we don't care if that
cabal-install was built with GHC 8.10.
This gives more chance for theses tools to work and be in the binary
cache of nixpkgs.
* nix: disable shake-bench for ghc921
* nix: fix ghc 9.2 shell
* nix: explicit cabal project in devShell
Using alias, we get the "correct" behavior when typing `cabal build` in
the nix-shell, it points to the current cabal-project file.
* nix: remove special case for different ghc versions
* nix: move implicit-hie-cradle as a flake input
* nix: restore dev shell
This commit restores a working behavior for `nix-shell` or `nix
develop`, for all supported GHC versions.
When entering a `nix-shell`, or `nix develop
.#haskell-language-server-ghcXxX-dev` you will get an environment with
all the dependencies needed to run `cabal build`.
Haskell dependencies will be built by cabal instead of nix. This may be
more robust compared to a shell where dependencies are built by nix:
- It won't try to build any dependency with nix. This mean that it won't
benefit from nix caching, but on the other hand, it will perfectly
match the cabal plan.
- The nix shell may fail to start if an (possibly unneeded) dependency
was failing to build.
Entering nix-shell also generates an alias command `cabal_project` which
runs cabal with the correct project file if needed (e.g. for GHC 9.0 and
9.2). Users are notified with a message when entering the shell.
The old behavior (i.e. where dependencies are built with nix) is still
available with `nix develop .#haskell-language-server-xxx-dev-nix` (i.e.
suffix the name of the shell with `-nix`).
* nix: New entries which build all target at once
All HLS version can be built with `nix build
.#all-haskell-language-server`, and all development shells with `nix
build .#all-dev-shells`.
I had to workaround a limitation in `nix build` which is not able to
build multiples targets, instead I used linkFarmFromDrvs.
All packages and shells are now named with a unique package name
containing the GHC version.
* nix: Build all devShells and all binaries in CI
* nix: build HLS with dynamic linking
Related to #2668.
This fixs the build, however, because now HLS is dynamicly linked, it
pulls GHC as a dependency. The uncompressed closure size is now `~6GiB`.
* nix; fix CI command
* nix: only build dev shell with nix packages for current GHC version
* Another tentative to fix the build
* fix: Eval and alternate number format works with ghc 9.2
* fix CI build
* ANother tentative fix
2022-02-16 15:24:22 +03:00
# We try to build as much as possible, but not much shells are
# working (especially on darwing), so this list is limited.
all-nix-dev-shells = linkFarmFromDrvs " a l l - d e v - s h e l l s " ( builtins . map ( shell : shell . inputDerivation ) ( lib . unique [ nixDevShells . haskell-language-server-dev-nix ] ) ) ;
2021-08-11 11:54:51 +03:00
Nix flake fix dev shells (#2655)
* nix: ghc92: ignore broken plugins
* nix: use current ghc for tools in the shell
Theses tools are pulled in the shell, but we don't need them to match
the GHC version used for development. Said otherwise, as long as we use
a working `cabal-install` to build with GHC 9.2, we don't care if that
cabal-install was built with GHC 8.10.
This gives more chance for theses tools to work and be in the binary
cache of nixpkgs.
* nix: disable shake-bench for ghc921
* nix: fix ghc 9.2 shell
* nix: explicit cabal project in devShell
Using alias, we get the "correct" behavior when typing `cabal build` in
the nix-shell, it points to the current cabal-project file.
* nix: remove special case for different ghc versions
* nix: move implicit-hie-cradle as a flake input
* nix: restore dev shell
This commit restores a working behavior for `nix-shell` or `nix
develop`, for all supported GHC versions.
When entering a `nix-shell`, or `nix develop
.#haskell-language-server-ghcXxX-dev` you will get an environment with
all the dependencies needed to run `cabal build`.
Haskell dependencies will be built by cabal instead of nix. This may be
more robust compared to a shell where dependencies are built by nix:
- It won't try to build any dependency with nix. This mean that it won't
benefit from nix caching, but on the other hand, it will perfectly
match the cabal plan.
- The nix shell may fail to start if an (possibly unneeded) dependency
was failing to build.
Entering nix-shell also generates an alias command `cabal_project` which
runs cabal with the correct project file if needed (e.g. for GHC 9.0 and
9.2). Users are notified with a message when entering the shell.
The old behavior (i.e. where dependencies are built with nix) is still
available with `nix develop .#haskell-language-server-xxx-dev-nix` (i.e.
suffix the name of the shell with `-nix`).
* nix: New entries which build all target at once
All HLS version can be built with `nix build
.#all-haskell-language-server`, and all development shells with `nix
build .#all-dev-shells`.
I had to workaround a limitation in `nix build` which is not able to
build multiples targets, instead I used linkFarmFromDrvs.
All packages and shells are now named with a unique package name
containing the GHC version.
* nix: Build all devShells and all binaries in CI
* nix: build HLS with dynamic linking
Related to #2668.
This fixs the build, however, because now HLS is dynamicly linked, it
pulls GHC as a dependency. The uncompressed closure size is now `~6GiB`.
* nix; fix CI command
* nix: only build dev shell with nix packages for current GHC version
* Another tentative to fix the build
* fix: Eval and alternate number format works with ghc 9.2
* fix CI build
* ANother tentative fix
2022-02-16 15:24:22 +03:00
all-simple-dev-shells = linkFarmFromDrvs " a l l - d e v - s h e l l s " ( builtins . map ( shell : shell . inputDerivation ) ( lib . unique ( builtins . attrValues simpleDevShells ) ) ) ;
2021-08-11 11:54:51 +03:00
docs = docs ;
2021-05-19 10:32:23 +03:00
} ;
2022-05-13 12:09:51 +03:00
# The attributes for the default shell and package changed in recent versions of Nix,
# these are here for backwards compatibility with the old versions.
devShell = devShells . default ;
defaultPackage = packages . default ;
2021-05-19 10:32:23 +03:00
} ) ;
2022-04-20 01:51:40 +03:00
nixConfig = {
extra-substituters = [
" h t t p s : / / h a s k e l l - l a n g u a g e - s e r v e r . c a c h i x . o r g "
] ;
extra-trusted-public-keys = [
" h a s k e l l - l a n g u a g e - s e r v e r . c a c h i x . o r g - 1 : j u F f H r w k O x q I O Z S h t C 4 Y C 1 u T 1 b B c q 2 R S v C 7 O M K x 0 N z 8 = "
] ;
} ;
2021-05-19 10:32:23 +03:00
}