Skip to content

Commit

Permalink
Pin Haskell tool versions for VS Code
Browse files Browse the repository at this point in the history
This also has the flake get its version pins (when possible) from the VS
Code settings. And we pin Cabal now, too.
  • Loading branch information
sellout committed Jul 9, 2024
1 parent ecf5fe1 commit c3405c2
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 deletions.
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"
}
}
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

0 comments on commit c3405c2

Please sign in to comment.