mirror of
https://git.sr.ht/~magic_rb/haskell-games
synced 2024-11-25 17:46:14 +01:00
77 lines
2.5 KiB
Nix
77 lines
2.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.fourmolu
|
|
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
|
|
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;
|
|
};
|
|
}
|
|
);
|
|
};
|
|
}
|