haskell-games/flake.nix

79 lines
2.5 KiB
Nix
Raw Permalink Normal View History

2023-09-25 15:25:46 +02:00
{
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."ghc96";
2023-09-25 15:25:46 +02:00
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.fourmolu
2023-09-25 15:25:46 +02:00
hPkgs.ghc
hPkgs.implicit-hie
hPkgs.haskell-language-server
hPkgs.profiterole
2023-09-25 15:25:46 +02:00
SDL2
SDL2_image
libtiff
libwebp
pkg-config
xorg.libXinerama
xorg.libX11
xorg.libXcursor
xorg.libXrandr
xorg.libXi
xorg.libXext
xorg.libXdmcp
xorg.libXxf86vm
libglvnd
httplz
((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;
2023-09-25 15:25:46 +02:00
};
}
);
};
}