72 lines
2.2 KiB
Nix
72 lines
2.2 KiB
Nix
{
|
|
description = "A game stub written in Haskell";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
};
|
|
|
|
outputs = { self, nixpkgs, flake-utils }:
|
|
flake-utils.lib.eachDefaultSystem (system:
|
|
let
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
|
|
nixos-lib = import (nixpkgs + "/nixos/lib") {};
|
|
|
|
haskellPackages = pkgs.haskellPackages.override {
|
|
overrides = final: prev: {
|
|
wavefront = jailbreakUnbreak prev.wavefront;
|
|
};
|
|
};
|
|
|
|
jailbreakUnbreak = pkg:
|
|
pkgs.haskell.lib.doJailbreak (pkg.overrideAttrs (_: { meta = { }; }));
|
|
|
|
packageName = "vulkan-tutorial";
|
|
in rec {
|
|
packages = rec {
|
|
vulkan-tutorial = # (ref:haskell-package-def)
|
|
haskellPackages.callCabal2nix packageName self rec {
|
|
# Dependency overrides go here
|
|
wavefront = haskellPackages.wavefront;
|
|
};
|
|
default = vulkan-tutorial;
|
|
};
|
|
|
|
devShells.${system} = haskellPackages.shellFor {
|
|
packages = p: [ packages.vulkan-tutorial ];
|
|
withHoogle = true;
|
|
buildInputs = (with haskellPackages; [
|
|
haskell-language-server
|
|
ghcid
|
|
cabal-install
|
|
(jailbreakUnbreak wavefront)
|
|
]) ++ (with pkgs; [
|
|
shaderc
|
|
vulkan-loader
|
|
vulkan-validation-layers
|
|
renderdoc
|
|
]);
|
|
VK_LAYER_PATH="${pkgs.vulkan-validation-layers}/share/vulkan/explicit_layer.d";
|
|
SDL_VULKAN_LIBRARY="${pkgs.vulkan-loader}/lib/libvulkan.so";
|
|
};
|
|
#devShells.${system} = pkgs.mkShell {
|
|
# buildInputs = with haskellPackages; [
|
|
# haskell-language-server
|
|
# ghcid
|
|
# cabal-install
|
|
# ];
|
|
# nativeBuildInputs = with pkgs; [
|
|
# pkg-config
|
|
# SDL2
|
|
# vulkan-validation-layers
|
|
# vulkan-headers
|
|
# vulkan-loader
|
|
# ];
|
|
# inputsFrom = builtins.attrValues self.packages.${system};
|
|
# VK_LAYER_PATH="${pkgs.vulkan-validation-layers}/share/vulkan/explicit_layer.d";
|
|
# SDL_VULKAN_LIBRARY="${pkgs.vulkan-loader}/lib/libvulkan.so";
|
|
#};
|
|
});
|
|
}
|
|
|