add flake-haskell

This commit is contained in:
Dmitriy Pleshevskiy 2022-09-13 23:38:27 +03:00
parent d9db6faf24
commit f72dd6a30e
Signed by: pleshevskiy
GPG key ID: 1B59187B161C0215
3 changed files with 53 additions and 0 deletions

View file

@ -12,6 +12,10 @@
path = ./flakes/rust;
description = "Flake to develop, build and run a rust application";
};
flake-haskell = {
path = ./flakes/haskell;
description = "Flake to develop haskell application";
};
flake-jupyter = {
path = ./flakes/jupyter;
description = "Flake to configure jupyter lab";

1
flakes/haskell/.envrc Normal file
View file

@ -0,0 +1 @@
use flake

48
flakes/haskell/flake.nix Normal file
View file

@ -0,0 +1,48 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, utils }:
utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
hPkgs = pkgs.haskellPackages;
stack-wrapped = pkgs.symlinkJoin {
name = "stack";
paths = [ pkgs.stack ];
buildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/stack \
--add-flags "\
--nix \
--no-nix-pure \
--no-install-ghc \
--system-ghc \
"
'';
};
myDevTools = with hPkgs; [
ghc
ghcid
ormolu
hlint
hoogle
haskell-language-server
implicit-hie
retrie
stack-wrapped
pkgs.zlib
];
in
{
devShells.default = pkgs.mkShell {
buildInputs = myDevTools;
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath myDevTools;
};
});
}