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

2
.envrc
View file

@ -1 +1 @@
use flake
use flake --impure

View file

@ -18,6 +18,29 @@
"type": "github"
}
},
"nixgl": {
"inputs": {
"flake-utils": [
"flake-utils"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1713543440,
"narHash": "sha256-lnzZQYG0+EXl/6NkGpyIz+FEOc/DSEG57AP1VsdeNrM=",
"owner": "nix-community",
"repo": "nixGL",
"rev": "310f8e49a149e4c9ea52f1adf70cdc768ec53f8a",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixGL",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1730831018,
@ -37,6 +60,7 @@
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nixgl": "nixgl",
"nixpkgs": "nixpkgs",
"rust-overlay": "rust-overlay"
}

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 ]);
};