Skip to content
Open
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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,12 @@ tags

# Emacs
*#
.\#*
.dir-locals.el
TAGS

# direnv
.envrc

# other
.DS_Store
14 changes: 14 additions & 0 deletions nix/stack-integration.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
let
pkgs = import <nixpkgs> {};
in

pkgs.haskell.lib.buildStackProject {
ghc = pkgs.haskell.compiler.ghc8107;
name = "piece-of-cake-slayer";
# System dependencies needed at compilation time
buildInputs = [
pkgs.zlib
pkgs.postgresql
pkgs.protobuf
];
}
23 changes: 23 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
let
pkgs = import <nixpkgs> {};

stack-wrapped = pkgs.symlinkJoin {
name = "stack";
paths = [ pkgs.stack ];
buildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/stack \
--add-flags "\
--nix \
--no-nix-pure \
--nix-shell-file=nix/stack-integration.nix \
"
'';
};

in
pkgs.mkShell {
# Do NOT use `stack`, otherwise system dependencies like `zlib` are missing at compilation
buildInputs = [ stack-wrapped ];
NIX_PATH = "nixpkgs=" + pkgs.path;
}