Skip to content

Instantly share code, notes, and snippets.

@silky
Forked from Gabriella439/default.nix
Created January 8, 2022 19:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save silky/ba403679d8709d3bff187daf73374efc to your computer and use it in GitHub Desktop.
Save silky/ba403679d8709d3bff187daf73374efc to your computer and use it in GitHub Desktop.
Nix build of vscode with haskell-language-server
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