Skip to content

Commit 222fda8

Browse files
adithyaovharendra-kumar
authored andcommitted
Add a default.nix and move cabal.project to cabal.project.user
1 parent 45cdca1 commit 222fda8

File tree

3 files changed

+47
-1
lines changed

3 files changed

+47
-1
lines changed

.github/workflows/packcheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
# ------------------------------------------------------------------------
2323
CABAL_CHECK_RELAX: y
2424
CABAL_NO_SANDBOX: y
25-
CABAL_PROJECT: cabal.project
25+
CABAL_PROJECT: cabal.project.user
2626

2727
# ------------------------------------------------------------------------
2828
# Location of packcheck.sh
File renamed without changes.

default.nix

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# CAUTION! a spelling mistake in arg string is ignored silently.
2+
#
3+
# To use ghc-8.10.7
4+
# nix-shell --argstr compiler "ghc8107"
5+
6+
{
7+
nixpkgs ?
8+
import (builtins.fetchTarball
9+
https://github.com/NixOS/nixpkgs/archive/refs/tags/22.05.tar.gz)
10+
{}
11+
, compiler ? "ghc922"
12+
}:
13+
let
14+
utils =
15+
let src = fetchGit {
16+
url = "[email protected]:composewell/composewell-haskell.git";
17+
ref = "master";
18+
}; in (import "${src}/utils.nix") { inherit nixpkgs; };
19+
20+
21+
haskellPackages =
22+
let src = fetchGit {
23+
url = "[email protected]:composewell/composewell-haskell.git";
24+
ref = "master";
25+
}; in (import "${src}/haskellPackages.nix")
26+
{ inherit nixpkgs;
27+
inherit compiler; };
28+
29+
mkHaskellPackages = inShell:
30+
haskellPackages.override (old: {
31+
overrides =
32+
nixpkgs.lib.composeExtensions
33+
(old.overrides or (_: _: {}))
34+
(with nixpkgs.haskell.lib; self: super: {
35+
packdiff =
36+
utils.local super "packdiff" ./. "" inShell;
37+
});
38+
});
39+
40+
shellDrv = mkHaskellPackages true;
41+
42+
shell = utils.mkShell shellDrv (p: [p.packdiff]) true;
43+
44+
in if nixpkgs.lib.inNixShell
45+
then shell
46+
else (mkHaskellPackages false).packdiff

0 commit comments

Comments
 (0)