Add possibility to run program from nix shell
Some checks failed
Build legacy Nix package on Ubuntu / build (push) Failing after 0s

This commit is contained in:
Florian RICHER 2024-11-19 17:42:35 +01:00
parent 504fdada42
commit 8f1172e888
3 changed files with 37 additions and 5 deletions

View file

@ -8,14 +8,20 @@
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
nixgl = {
url = "github:nix-community/nixGL";
inputs.nixpkgs.follows = "nixpkgs";
inputs.flake-utils.follows = "flake-utils";
};
};
outputs = { self, nixpkgs, flake-utils, rust-overlay }:
outputs = { self, nixpkgs, flake-utils, rust-overlay, nixgl }:
flake-utils.lib.eachSystem flake-utils.lib.allSystems (system:
let
overlays = [ (import rust-overlay) ];
overlays = [ (import rust-overlay) nixgl.overlay ];
pkgs = import nixpkgs {
inherit system overlays;
config.allowUnfree = true;
};
rust = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
@ -24,7 +30,7 @@
cargo = rust;
});
libs = with pkgs; [ vulkan-headers vulkan-loader ]
libs = with pkgs; [ vulkan-headers vulkan-loader vulkan-validation-layers ]
++ pkgs.lib.optionals pkgs.stdenv.hostPlatform.isLinux (with pkgs; [ libxkbcommon wayland libGL ])
++ pkgs.lib.optionals pkgs.stdenv.hostPlatform.isDarwin (with pkgs; [ darwin.apple_sdk.frameworks.SystemConfiguration ]);
in
@ -36,7 +42,9 @@
pkg-config
];
buildInputs = libs;
buildInputs = libs ++ [
pkgs.nixgl.auto.nixVulkanNvidia pkgs.nixgl.nixVulkanIntel
];
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath (with pkgs; [ libxkbcommon wayland libGL ]);
};