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

[ #206 ] Deriving FromField/ToField instances #207

Draft
wants to merge 20 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Nix integration
stevladimir committed Nov 3, 2022
commit 38a8597a8917c9843603e0af1a8ea6bea4030464
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -8,6 +8,7 @@
.hpc/
dist/
dist-newstyle/
newdist/
cabal.sandbox.config
.ghc.environment.*
.stack-work
6 changes: 4 additions & 2 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
-- http://cabal.readthedocs.io/en/latest/nix-local-build-overview.html
packages: .
-- packages: examples/
packages:
./
benchmarks/
examples/

-- tests: True
28 changes: 28 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{ ghc
, doCheck ? true
, configureFlags ? [ ]
}:
let
haskellNixSrc = builtins.fetchTarball "https://github.com/input-output-hk/haskell.nix/archive/b3df33abbcb736437cb06d5f53a10f6bb271bc51.tar.gz";

haskellNix = import haskellNixSrc { };

pkgs = import haskellNix.sources.nixpkgs-unstable haskellNix.nixpkgsArgs;

in {
inherit pkgs;

project = pkgs.haskell-nix.cabalProject {
src = pkgs.haskell-nix.haskellLib.cleanGit {
name = "cassava";
src = ./.;
};
name = "cassava";
compiler-nix-name = ghc;
index-state = "2022-09-03T00:00:00Z";
modules = [
{ inherit doCheck configureFlags; }
];
};

}
33 changes: 33 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{ doCheck ? true
, ghc ? "ghc902"
, withHoogle ? true
, configureFlags ? [ ]
}:
let
result = import ./default.nix {
inherit configureFlags doCheck ghc;
};

inherit (result) pkgs project;
hsPkgs = pkgs.haskell.packages.${ghc};

in project.shellFor {

inherit withHoogle;

exactDeps = true;

# We have to add 'criterion' explicitly as it depends on 'cassava' itself,
# so it will be dropped from included dependencies and benchmarks build fails.
# https://github.com/input-output-hk/haskell.nix/blob/b3df33abbcb736437cb06d5f53a10f6bb271bc51/builder/shell-for.nix#L31-L49)
additional = ps: [ps.criterion.components.library];

buildInputs = [
hsPkgs.cabal-install
hsPkgs.haskell-language-server
];

LANG = "en_US.utf8";
LC_ALL = "en_US.utf8";
LOCALE_ARCHIVE = "${pkgs.glibcLocales}/lib/locale/locale-archive";
}