diff --git a/flake.nix b/flake.nix index e797a3b..3c01d9a 100644 --- a/flake.nix +++ b/flake.nix @@ -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"; diff --git a/flakes/haskell/.envrc b/flakes/haskell/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/flakes/haskell/.envrc @@ -0,0 +1 @@ +use flake diff --git a/flakes/haskell/flake.nix b/flakes/haskell/flake.nix new file mode 100644 index 0000000..3cf5d75 --- /dev/null +++ b/flakes/haskell/flake.nix @@ -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; + }; + }); +}