A simple CPU rendered GUI IDE experience.
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix83
1 files changed, 83 insertions, 0 deletions
diff --git a/flake.nix b/flake.nix
new file mode 100644
index 0000000..dc427ab
--- /dev/null
+++ b/flake.nix
@@ -0,0 +1,83 @@
+{
+ inputs = {
+ nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
+ flake-utils.url = "github:numtide/flake-utils";
+ rust-overlay = {
+ url = "github:oxalica/rust-overlay";
+ inputs.nixpkgs.follows = "nixpkgs";
+ };
+ };
+
+ outputs = inputs @ { self, nixpkgs, flake-utils, rust-overlay, ... }:
+ flake-utils.lib.eachDefaultSystem (
+ system: let
+ overlays = [ (import rust-overlay) ];
+ pkgs = import nixpkgs { inherit system overlays; };
+ in {
+ devShells.default = with pkgs; mkShell rec {
+ buildInputs = [
+ (rust-bin.nightly.latest.minimal.override {
+ extensions = [ "clippy" "rust-analyzer" "rust-docs" "rust-src" "miri" ];
+ })
+ # We use nightly rustfmt features.
+ (rust-bin.selectLatestNightlyWith (toolchain: toolchain.rustfmt))
+
+ # Vulkan dependencies
+ shaderc
+ spirv-tools
+ vulkan-loader
+ vulkan-tools
+ vulkan-tools-lunarg
+ vulkan-validation-layers
+ vulkan-extension-layer
+
+ # winit dependencies
+ libxkbcommon
+ wayland
+ xorg.libX11
+ xorg.libXcursor
+ xorg.libXi
+ xorg.libXrandr
+ SDL2
+
+ clang
+ libclang
+ glibc.dev
+
+ valgrind
+ gdb
+ ];
+
+ LD_LIBRARY_PATH = lib.makeLibraryPath buildInputs;
+ SHADERC_LIB_DIR = lib.makeLibraryPath [ shaderc ];
+ VK_LAYER_PATH = "${vulkan-validation-layers}/share/vulkan/explicit_layer.d";
+ };
+ devShells.CI = with pkgs; mkShell rec {
+ buildInputs = [
+ (rust-bin.stable.latest.minimal.override {
+ extensions = [ "clippy" ];
+ # Windows CI unfortunately needs to cross-compile from within WSL because Nix doesn't
+ # work on Windows.
+ targets = [ "x86_64-pc-windows-msvc" ];
+ })
+ # We use nightly rustfmt features.
+ (rust-bin.selectLatestNightlyWith (toolchain: toolchain.rustfmt))
+
+ # Vulkan dependencies
+ shaderc
+
+ # winit dependencies
+ libxkbcommon
+ wayland
+ xorg.libX11
+ xorg.libXcursor
+ xorg.libXi
+ xorg.libXrandr
+ ];
+
+ LD_LIBRARY_PATH = lib.makeLibraryPath buildInputs;
+ SHADERC_LIB_DIR = lib.makeLibraryPath [ shaderc ];
+ };
+ }
+ );
+}