vulkan-tutorial/flake.nix

73 lines
2.2 KiB
Nix
Raw Normal View History

2022-12-01 12:18:38 +00:00
{
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};
2023-08-24 01:51:18 +00:00
nixos-lib = import (nixpkgs + "/nixos/lib") {};
2023-08-24 15:01:49 +00:00
haskellPackages = pkgs.haskellPackages.override {
overrides = final: prev: {
wavefront = jailbreakUnbreak prev.wavefront;
};
};
2022-12-01 12:18:38 +00:00
jailbreakUnbreak = pkg:
pkgs.haskell.lib.doJailbreak (pkg.overrideAttrs (_: { meta = { }; }));
packageName = "vulkan-tutorial";
2022-12-02 01:57:30 +00:00
in rec {
2023-08-24 01:51:18 +00:00
packages = rec {
vulkan-tutorial = # (ref:haskell-package-def)
haskellPackages.callCabal2nix packageName self rec {
# Dependency overrides go here
2023-08-24 15:01:49 +00:00
wavefront = haskellPackages.wavefront;
2022-12-01 12:18:38 +00:00
};
2023-08-24 14:00:27 +00:00
default = vulkan-tutorial;
2023-08-24 01:51:18 +00:00
};
2023-08-24 14:00:27 +00:00
devShells.${system} = haskellPackages.shellFor {
packages = p: [ packages.vulkan-tutorial ];
2022-12-02 01:57:30 +00:00
withHoogle = true;
2022-12-02 09:09:01 +00:00
buildInputs = (with haskellPackages; [
2022-12-01 12:18:38 +00:00
haskell-language-server
ghcid
cabal-install
2023-10-21 23:15:03 +00:00
(jailbreakUnbreak wavefront)
2022-12-02 09:09:01 +00:00
]) ++ (with pkgs; [
shaderc
vulkan-loader
vulkan-validation-layers
2023-04-02 11:46:38 +00:00
renderdoc
2022-12-02 09:09:01 +00:00
]);
2023-04-07 23:55:11 +00:00
VK_LAYER_PATH="${pkgs.vulkan-validation-layers}/share/vulkan/explicit_layer.d";
SDL_VULKAN_LIBRARY="${pkgs.vulkan-loader}/lib/libvulkan.so";
2022-12-01 12:18:38 +00:00
};
2023-08-24 15:03:24 +00:00
#devShells.${system} = pkgs.mkShell {
2022-12-02 01:57:30 +00:00
# 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};
2023-08-24 15:03:24 +00:00
# VK_LAYER_PATH="${pkgs.vulkan-validation-layers}/share/vulkan/explicit_layer.d";
# SDL_VULKAN_LIBRARY="${pkgs.vulkan-loader}/lib/libvulkan.so";
2022-12-02 01:57:30 +00:00
#};
2023-08-24 01:58:29 +00:00
});
2022-12-01 12:18:38 +00:00
}