Skip to content

Commit 7f1bb8b

Browse files
committed
Eliminate mixed Nixpkgs
There were two Nixpkgs inputs, with one being used solely to get a particular version of Stack. This now “compromises” on the same release of Nixpkgs as used for Stack, but from the haskell.nix project to have a consistent package set. There are also a few other version bumps here (because once you change an uncached input, you might as well upgrade everything): - bump LTS to 22.43 (GHC 9.6.6 from 9.6.5) - bump HLS to 2.9 (this is now transitively included via the haskell.nix input) - bump hpack to 0.36.0 (this is actually the minimum bound for the version of Stack we use, so the previous setting was inconsistent)
1 parent cece289 commit 7f1bb8b

File tree

7 files changed

+85
-78
lines changed

7 files changed

+85
-78
lines changed

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"haskell.toolchain": {
33
"cabal": "3.10.3.0",
4-
"hls": "2.8.0.0",
4+
"hls": "2.9.0.0",
55
"stack": "2.15.7"
66
}
77
}

flake.lock

Lines changed: 54 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,14 @@
88

99
inputs = {
1010
haskellNix.url = "github:input-output-hk/haskell.nix";
11-
nixpkgs-haskellNix.follows = "haskellNix/nixpkgs-unstable";
12-
nixpkgs-release.url = "github:NixOS/nixpkgs/release-24.05";
11+
nixpkgs.follows = "haskellNix/nixpkgs-2405";
1312
flake-utils.url = "github:numtide/flake-utils";
1413
};
1514

1615
outputs = {
1716
self,
1817
haskellNix,
19-
nixpkgs-haskellNix,
20-
nixpkgs-release,
18+
nixpkgs,
2119
flake-utils,
2220
}:
2321
flake-utils.lib.eachSystem [
@@ -28,32 +26,32 @@
2826
(system: let
2927
## It’s much easier to read from a JSON file than to have JSON import from some other file, so we extract some
3028
## configuration from the VS Code settings to avoid duplication.
31-
vscodeSettings = nixpkgs-release.lib.importJSON ./.vscode/settings.json;
29+
vscodeSettings = nixpkgs.lib.importJSON ./.vscode/settings.json;
3230
versions =
3331
vscodeSettings."haskell.toolchain"
3432
## There are some things we want to pin that the VS Code Haskell extension doesn’t let us control.
3533
// {
36-
hpack = "0.35.2";
37-
ormolu = "0.7.2.0";
38-
};
39-
pkgs = import nixpkgs-haskellNix {
34+
hpack = "0.36.0";
35+
ormolu = "0.7.2.0";
36+
};
37+
pkgs = import nixpkgs {
4038
inherit system;
4139
inherit (haskellNix) config;
4240
overlays = [
4341
haskellNix.overlay
44-
(import ./nix/dependencies.nix {inherit nixpkgs-release;})
42+
(import ./nix/dependencies.nix)
4543
];
4644
};
4745
unison-project = import ./nix/unison-project.nix {
48-
inherit (nixpkgs-haskellNix) lib;
46+
inherit (nixpkgs) lib;
4947
inherit (pkgs) haskell-nix;
5048
};
5149
haskell-nix-flake = import ./nix/haskell-nix-flake.nix {
5250
inherit pkgs unison-project versions;
53-
inherit (nixpkgs-haskellNix) lib;
51+
inherit (nixpkgs) lib;
5452
};
5553
renameAttrs = fn:
56-
nixpkgs-haskellNix.lib.mapAttrs' (name: value: {
54+
nixpkgs.lib.mapAttrs' (name: value: {
5755
inherit value;
5856
name = fn name;
5957
});
@@ -71,11 +69,10 @@
7169
all = pkgs.symlinkJoin {
7270
name = "all";
7371
paths = let
74-
all-other-packages =
75-
builtins.attrValues (builtins.removeAttrs self.packages."${system}" [
76-
"all"
77-
"docker-ucm" # this package doesn’t produce a directory
78-
]);
72+
all-other-packages = builtins.attrValues (builtins.removeAttrs self.packages."${system}" [
73+
"all"
74+
"docker-ucm" # this package doesn’t produce a directory
75+
]);
7976
devshell-inputs =
8077
builtins.concatMap
8178
(devShell: devShell.buildInputs ++ devShell.nativeBuildInputs)

nix/dependencies.nix

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,13 @@
1-
{nixpkgs-release}: final: prev: let
2-
pinned-pkgs = import nixpkgs-release {inherit (final) system;};
3-
in {
4-
stack = pinned-pkgs.stack;
5-
1+
final: prev: {
62
## See https://docs.haskellstack.org/en/stable/nix_integration/#supporting-both-nix-and-non-nix-developers for an
7-
## explanation of this package.
8-
stack-wrapped = final.symlinkJoin {
9-
name = "stack"; # will be available as the usual `stack` in terminal
10-
paths = [final.stack];
3+
## explanation of this derivation.
4+
stack = final.symlinkJoin {
5+
inherit (prev.stack) version;
6+
name = "stack";
7+
paths = [prev.stack];
118
buildInputs = [final.makeWrapper];
129
postBuild = ''
13-
wrapProgram $out/bin/stack \
14-
--add-flags "\
15-
--no-nix \
16-
--system-ghc \
17-
--no-install-ghc \
18-
"
10+
wrapProgram $out/bin/stack --add-flags "--no-nix --system-ghc --no-install-ghc"
1911
'';
2012
};
2113
}

nix/haskell-nix-flake.nix

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
pkgs.gettext # for envsubst, used by unison-src/builtin-tests/interpreter-tests.sh
3636
pkgs.hpack
3737
pkgs.pkg-config
38-
pkgs.stack-wrapped
38+
pkgs.stack
3939
];
4040
# workaround for https://gitlab.haskell.org/ghc/ghc/-/issues/11042
4141
shellHook = ''
@@ -44,8 +44,7 @@
4444
tools =
4545
(args.tools or {})
4646
// {
47-
cabal = {version = versions.cabal;};
48-
ormolu = {version = versions.ormolu;};
47+
cabal.version = versions.cabal;
4948
haskell-language-server = {
5049
version = versions.hls;
5150
modules = [
@@ -64,6 +63,7 @@
6463
constraints: ormolu == ${versions.ormolu}
6564
'';
6665
};
66+
ormolu.version = versions.ormolu;
6767
};
6868
};
6969

stack.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ packages:
5050
- unison-syntax
5151
- yaks/easytest
5252

53-
resolver: lts-22.26
53+
resolver: lts-22.43
5454

5555
extra-deps:
5656
# This custom Haskeline alters ANSI rendering on Windows.

stack.yaml.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ packages:
5959
hackage: network-udp-0.0.0@sha256:408d2d4fa1a25e49e95752ee124cca641993404bb133ae10fb81daef22d876ae,1075
6060
snapshots:
6161
- completed:
62-
sha256: 8e7996960d864443a66eb4105338bbdd6830377b9f6f99cd5527ef73c10c01e7
63-
size: 719128
64-
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/26.yaml
65-
original: lts-22.26
62+
sha256: 08bd13ce621b41a8f5e51456b38d5b46d7783ce114a50ab604d6bbab0d002146
63+
size: 720271
64+
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/43.yaml
65+
original: lts-22.43

0 commit comments

Comments
 (0)