haskell-games/flake.nix
magic_rb 7080653ca1
RPG starting point
Signed-off-by: magic_rb <richard@brezak.sk>
2023-10-11 19:53:20 +02:00

75 lines
2.4 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
xorg.libXinerama
xorg.libX11
xorg.libXcursor
xorg.libXrandr
xorg.libXi
xorg.libXext
xorg.libXdmcp
libglvnd
((raylib.override { includeEverything = true; }).overrideAttrs (old: {
patches = [];
src = fetchFromGitHub {
owner = "raysan5";
repo = "raylib";
rev = "b8cd10264b6d34ff4b09ccdd0b0f7b254cf3b122";
sha256 = "sha256-VRNQZ0Pp1uczhLSF4Hz2QWiEini2jFtEGJDZMcLE+0w=";
};
postFixup = ''
cp ../src/*.h $out/include/
'';
}))
glfw
] ++ pkgs.glfw.buildInputs;
};
}
);
};
}