Skip to content
Merged
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
27 changes: 26 additions & 1 deletion cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ else

benchmarks: True
tests: True
allow-newer: hedgehog:pretty-show, hedgehog-classes:pretty-show, hedgehog-classes:hedgehog, *:time, logging-effect:base, servant:base, http-api-data:base
--allow-newer: hedgehog:pretty-show, hedgehog-classes:pretty-show, hedgehog-classes:hedgehog, *:time, logging-effect:base, servant:base, http-api-data:base
allow-newer: all

package primer
test-options: "--size-cutoff=32768"
Expand All @@ -48,6 +49,30 @@ if arch(wasm32)
package tasty
flags: -unix

-- Sigh.
source-repository-package
type: git
location: https://github.com/hackworthltd/these
--sha256: sha256-QaldABOjeqMVRaivBU3pW1WodqCSyd8Iy5jid1zTm4Y=
tag: 4392ae17a278b3b2c949862fe1caf8eeacb4e0c6
subdir: these

-- Sigh.
source-repository-package
type: git
location: https://github.com/hackworthltd/indexed-traversable
--sha256: sha256-NQhhID02npxFSEE9RWoBtUaa8IB3lm5wovJMDMGS1EM=
tag: afccfb663c5d0a168a9ca97151b32bda715a4957
subdir: indexed-traversable-instances

-- Sigh.
source-repository-package
type: git
location: https://github.com/hackworthltd/indexed-traversable
--sha256: sha256-NQhhID02npxFSEE9RWoBtUaa8IB3lm5wovJMDMGS1EM=
tag: afccfb663c5d0a168a9ca97151b32bda715a4957
subdir: indexed-traversable
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pretty sure you can pass multiple values here instead of repeating the stuff above.


-- Using unreleased support for components.
source-repository-package
type: git
Expand Down
93 changes: 90 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 33 additions & 16 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
treefmt-nix.inputs.nixpkgs.follows = "nixpkgs";

ghc-wasm.url = "git+https://gitlab.haskell.org/ghc/ghc-wasm-meta";

haskell-language-server.url = "github:haskell/haskell-language-server/fe6551bca3b4a7fa7f161e485781bf2ba89f8c3a";
};

outputs = inputs@ { flake-parts, ... }:
Expand All @@ -45,7 +47,7 @@
in
builtins.trace "Nix Primer version is ${v}" "git-${v}";

ghcVersion = "ghc9122";
ghcVersion = "ghc9141";

# We must keep the weeder version in sync with the version of
# GHC we're using.
Expand Down Expand Up @@ -254,7 +256,6 @@
];

haskellNixTools = pkgs.haskell-nix.tools ghcVersion {
fourmolu = fourmoluVersion;
cabal-gild = "latest";
};
in
Expand All @@ -271,7 +272,7 @@
};
programs.fourmolu = {
enable = true;
package = haskellNixTools.fourmolu;
package = pkgs.fourmolu;
};
programs.nixpkgs-fmt.enable = true;
programs.shellcheck.enable = true;
Expand All @@ -290,7 +291,7 @@
wasm = pkgs.mkShell {
packages = with inputs.ghc-wasm.packages.${system};
[
all_9_12
all_9_14

pkgs.gnumake
pkgs.simple-http-server
Expand Down Expand Up @@ -320,6 +321,11 @@
{
overlays.default = (final: prev:
let
ghc9123Tools = final.haskell-nix.tools "ghc9123" {
fourmolu = fourmoluVersion;
hlint = "latest";
};

primer = final.haskell-nix.cabalProject {
compiler-nix-name = ghcVersion;
src = ./.;
Expand Down Expand Up @@ -365,7 +371,10 @@
doHaddock = true;
doHyperlinkSource = true;
doQuickjump = true;
doHoogle = true;

# Hoogle generation is currently broken:
# https://github.com/input-output-hk/haskell.nix/issues/2477
doHoogle = false;
}
{
# Some packages are not visible to haskell.nix's planner, and need
Expand Down Expand Up @@ -413,16 +422,23 @@
# See:
# https://github.com/hackworthltd/primer/issues/876
#exactDeps = true;
withHoogle = true;

tools = {
haskell-language-server = "latest";
# Hoogle generation is currently broken:
# https://github.com/input-output-hk/haskell.nix/issues/2477
withHoogle = false;

hlint = "latest";
tools = {
haskell-language-server = {
src = inputs.haskell-language-server;
};

ghcid = "latest";

implicit-hie = "latest";
implicit-hie = {
cabalProjectLocal = ''
allow-newer: all
'';
};

cabal = "latest";

Expand All @@ -431,8 +447,6 @@
# Disabled, as it doesn't currently build with Nix.
#weeder = weederVersion;

fourmolu = fourmoluVersion;

#TODO Explicitly requiring tasty-discover shouldn't be necessary - see the commented-out `build-tool-depends` in primer.cabal.
tasty-discover = "latest";
};
Expand All @@ -442,11 +456,12 @@

# For Language Server support.
nodejs_22
]);

shellHook = ''
export HIE_HOOGLE_DATABASE="$(cat $(${final.which}/bin/which hoogle) | sed -n -e 's|.*--database \(.*\.hoo\).*|\1|p')"
'';
# Normally available via `shell.tools`, but
# currently part of our overlay, instead.
hlint
fourmolu
]);
};
};

Expand Down Expand Up @@ -493,6 +508,8 @@
inherit (benchmarks) primer-benchmark-results-json;
inherit (benchmarks) primer-criterion-results-github-action-benchmark;
inherit (benchmarks) primer-benchmark-results-github-action-benchmark;

inherit (ghc9123Tools) fourmolu hlint;
}
);

Expand Down
2 changes: 1 addition & 1 deletion primer-api/primer-api.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ library
-fhide-source-paths

build-depends:
base >=4.12 && <4.22,
base >=4.12 && <4.23,
containers >=0.6.0.1 && <0.9.0,
deriving-aeson >=0.2 && <0.3.0,
extra >=1.7.10 && <1.9.0,
Expand Down
2 changes: 1 addition & 1 deletion primer-benchmark/primer-benchmark.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ library
exposed-modules: Benchmarks
build-depends:
aeson >=2.0 && <2.3,
base >=4.12 && <4.22,
base >=4.12 && <4.23,
containers >=0.6.0.1 && <0.9.0,
criterion ^>=1.6.0.0,
deepseq ^>=1.5,
Expand Down
2 changes: 1 addition & 1 deletion primer-miso/primer-miso.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ library

build-depends:
aeson >=2.0 && <2.3,
base >=4.12 && <4.22,
base >=4.12 && <4.23,
bytestring >=0.10.8.2 && <0.13,
clay >=0.15 && <0.17,
containers >=0.6.0.1 && <0.9.0,
Expand Down
2 changes: 1 addition & 1 deletion primer/primer.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ library
build-depends:
aeson >=2.0 && <2.3,
assoc ^>=1.1,
base >=4.12 && <4.22,
base >=4.12 && <4.23,
base64-bytestring ^>=1.2.1,
containers >=0.6.0.1 && <0.9.0,
deriving-aeson >=0.2 && <0.3.0,
Expand Down