templates/flakes/haskell/flake.nix
2022-09-13 23:38:27 +03:00

48 lines
1.1 KiB
Nix

{
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;
};
});
}