templates/flakes/haskell/flake.nix

48 lines
1.1 KiB
Nix

{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, flake-utils, ... }:
flake-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;
};
});
}