Skip to content

Shell nix further steps #240

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

Merged
merged 4 commits into from
Jul 26, 2020
Merged
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
65 changes: 60 additions & 5 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,36 +1,91 @@
# This shell.nix file is designed for use with cabal build
# It aims to leverage the nix cache in as much as possible
# while reducing Nix maintenance costs.
# It does **not** aim to replace Cabal/Stack with Nix


{ sources ? import nix/sources.nix,
nixpkgs ? import sources.nixpkgs {},
compiler ? "default"
}:
with nixpkgs;

let haskellPackagesForProject = if compiler == "default"
then haskellPackages.ghcWithPackages
else haskell.packages.${compiler}.ghcWithPackages;
let defaultCompiler = "ghc" + lib.replaceStrings ["."] [""] haskellPackages.ghc.version;
haskellPackagesForProject = p:
if compiler == "default" || compiler == defaultCompiler
then haskellPackages.ghcWithPackages p
# for all other compilers there is no Nix cache so dont bother building deps with NIx
else haskell.packages.${compiler}.ghcWithPackages [];

compilerWithPackages = haskellPackagesForProject(p:
with p;
[ aeson
[
Diff
Glob
HsYAML-aeson
QuickCheck
aeson
alex
async
base16-bytestring
blaze-builder
blaze-markup
brittany
conduit-extra
conduit-parse
cryptohash-sha1
data-default
data-default-class
data-default-instances-containers
data-default-instances-dlist
data-default-instances-old-locale
extra
floskell
fuzzy
generic-deriving
ghc-check
gitrev
haddock-library
happy
haskell-lsp
haskell-src-exts
hie-bios
hslogger
hspec
lens
lsp-test
megaparsec
network
opentelemetry
optparse-simple
ormolu
parser-combinators
parsers
prettyprinter
QuickCheck
prettyprinter-ansi-terminal
primes
psqueues
regex-tdfa
rope-utf16-splay
safe-exceptions
shake
sorted-list
strict
stylish-haskell
tasty
tasty-ant-xml
tasty-expected-failure
tasty-golden
tasty-hunit
tasty-rerun
temporary
text
typed-process
unix-compat
unordered-containers
xml
yaml
zlib
]);
in
stdenv.mkDerivation {
Expand Down