Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pin Haskell tool versions for VS Code #5196

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"haskell.toolchain": {
"cabal": "3.10.3.0",
"hls": "2.8.0.0",
"stack": "2.15.7"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if VS Code or the extension will complain if we put the other version pins here, so they’re all in one place.

Or is that a bad idea because VS Code users might think that it’s actually pinning Ormolu, etc.

}
}
12 changes: 8 additions & 4 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,15 @@
"aarch64-darwin"
]
(system: let
versions = {
ormolu = "0.7.2.0";
hls = "2.8.0.0";
stack = "2.15.7";
## It’s much easier to read from a JSON file than to have JSON import from some other file, so we extract some
## configuration from the VS Code settings to avoid duplication.
vscodeSettings = nixpkgs-release.lib.importJSON ./.vscode/settings.json;
versions =
vscodeSettings."haskell.toolchain"
## There are some things we want to pin that the VS Code Haskell extension doesn’t let us control.
// {
hpack = "0.35.2";
ormolu = "0.7.2.0";
};
pkgs = import nixpkgs-haskellNix {
inherit system;
Expand Down
2 changes: 1 addition & 1 deletion nix/haskell-nix-flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
tools =
(args.tools or {})
// {
cabal = {};
cabal = {version = versions.cabal;};
ormolu = {version = versions.ormolu;};
haskell-language-server = {
version = versions.hls;
Expand Down
Loading