Created
January 7, 2022 16:14
-
-
Save Gabriella439/b542f6e171f17d5f77a844d848278e14 to your computer and use it in GitHub Desktop.
Nix build of vscode with haskell-language-server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let | |
nixpkgs = builtins.fetchTarball { | |
url = "https://github.com/NixOS/nixpkgs/archive/c473cc8714710179df205b153f4e9fa007107ff9.tar.gz"; | |
sha256 = "0q7rnlp1djxc9ikj89c0ifzihl4wfvri3q1bvi75d2wrz844b4lq"; | |
}; | |
config = { | |
allowUnfree = true; | |
}; | |
ghcVersion = "8107"; | |
overlay = pkgsNew: pkgsOld: { | |
haskell-language-server = pkgsOld.haskell-language-server.override { | |
supportedGhcVersions = [ ghcVersion ]; | |
}; | |
haskell = pkgsOld.haskell // { | |
packages = pkgsOld.haskell.packages // { | |
"ghc${ghcVersion}" = pkgsOld.haskell.packages."ghc${ghcVersion}".override (old: { | |
overrides = | |
pkgsNew.lib.composeExtensions (old.overrides or (_: _: { })) | |
(haskellPackagesNew: haskellPackagesOld: { | |
ormolu = | |
if pkgsNew.system == "aarch64-darwin" | |
then | |
pkgsNew.haskell.lib.overrideCabal | |
haskellPackagesOld.ormolu | |
(_: { enableSeparateBinOutput = false; }) | |
else | |
haskellPackagesOld.ormolu; | |
}); | |
}); | |
}; | |
}; | |
vscode-with-extensions = pkgsOld.vscode-with-extensions.override { | |
vscodeExtensions = [ | |
pkgsNew.vscode-extensions.haskell.haskell | |
pkgsNew.vscode-extensions.justusadam.language-haskell | |
]; | |
}; | |
}; | |
pkgs = import nixpkgs { inherit config; overlays = [ overlay ];}; | |
in | |
{ inherit (pkgs) | |
haskell-language-server | |
vscode-with-extensions | |
; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looks like this depends on
python
as well as some weird "relative directory"-logic. The content ofpoints to
/nix/store/1066bs33qpbwa9k6b4lg71wg31q4xa9s-vscode-1.63.0/bin/code
which contains: