mirror of
https://git.sr.ht/~magic_rb/haskell-games
synced 2024-11-21 15:24:22 +01:00
54 lines
1.5 KiB
Nix
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
|
|
];
|
|
};
|
|
}
|
|
);
|
|
};
|
|
}
|