yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Sam EstepAllow `flake.nix` users to run Vulkan tests (#8152)719ecf3bf

master
2.1 KiB63 linesraw
1{
2  description = "The Slang Shading Language and Compiler";
3  inputs = {
4    nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
5    flake-utils.url = "github:numtide/flake-utils";
6  };
7  outputs =
8    {
9      self,
10      nixpkgs,
11      flake-utils,
12    }:
13    flake-utils.lib.eachDefaultSystem (
14      system:
15      let
16        pkgs = import nixpkgs { inherit system; };
17      in
18      {
19        # We want to use Clang instead of GCC because it seems to behave better
20        # with LLDB, so we use `mkShellNoCC` here instead of `mkShell` because
21        # the latter brings in GCC by default on Linux.
22        devShell = pkgs.mkShellNoCC {
23          buildInputs = [
24            # We must list clangd before the `clang` package to make sure it
25            # comes earlier on the `PATH`, and we must get it from the
26            # `clang-tools` package so that it is wrapped properly.
27            (pkgs.linkFarm "clangd-21" [
28              {
29                name = "bin/clangd";
30                # New enough to support `HeaderInsertion: Never` in `.clangd`.
31                path = "${pkgs.llvmPackages_21.clang-tools}/bin/clangd";
32              }
33            ])
34            (pkgs.linkFarm "clang-format-17" [
35              {
36                name = "bin/clang-format";
37                # Match the clang-format version used in CI.
38                path = "${pkgs.llvmPackages_17.clang-tools}/bin/clang-format";
39              }
40            ])
41
42            pkgs.clang
43            pkgs.cmake
44            pkgs.gersemi
45            pkgs.lldb
46            pkgs.ninja
47            pkgs.nixfmt-rfc-style
48            pkgs.prettier
49            pkgs.python3
50            pkgs.shfmt
51            pkgs.vulkan-loader # Ensure this gets built to use in library path.
52            pkgs.xorg.libX11
53          ];
54          LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [
55            # In addition to this, running the Vulkan tests on Linux distros
56            # other than NixOS may require the use of nixGL:
57            # https://github.com/nix-community/nixGL
58            pkgs.vulkan-loader
59          ];
60        };
61      }
62    );
63}