haskell-games/flake.nix
2023-09-25 15:25:46 +02:00

54 lines
1.5 KiB
Nix

{
inputs.nixpkgs.url = "github:NixOS/nixpkgs?ref=nixos-unstable";
outputs = { self, nixpkgs, ... }@inputs:
let
supportedSystems = [ "x86_64-linux" ];
forAllSystems' = nixpkgs.lib.genAttrs;
forAllSystems = forAllSystems' supportedSystems;
pkgsForSystem =
system:
import nixpkgs { inherit system; overlays = [ ]; };
in
{
devShells = forAllSystems (system:
let
pkgs = pkgsForSystem system;
hPkgs = pkgs.haskell.packages."ghc962";
stack-wrapper = pkgs.symlinkJoin {
name = "stack";
paths = [ pkgs.stack ];
buildInputs = [ pkgs.makeWrapper ];
postBuild = ''
wrapProgram $out/bin/stack \
--add-flags "\
--no-nix \
--system-ghc \
--no-install-ghc \
"
'';
};
in
{
default =
pkgs.mkShell rec {
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs;
buildInputs = with pkgs; [
stdenv.cc
stack-wrapper
hPkgs.ghc
hPkgs.implicit-hie
hPkgs.haskell-language-server
SDL2
SDL2_image
libtiff
libwebp
pkg-config
];
};
}
);
};
}