YAHOOO IT WORKS!!

main
Johannes Hendrik Gerard van der Weide 2023-11-21 17:53:04 +01:00
parent c929e27241
commit a5e6c99c47
2 changed files with 65 additions and 5 deletions

View File

@ -1,6 +1,21 @@
{ {
"nodes": { "nodes": {
"flake-utils": { "flake-utils": {
"locked": {
"lastModified": 1659877975,
"narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"flake-utils_2": {
"inputs": { "inputs": {
"systems": "systems" "systems": "systems"
}, },
@ -18,7 +33,41 @@
"type": "github" "type": "github"
} }
}, },
"nixgl": {
"inputs": {
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs"
},
"locked": {
"lastModified": 1685908677,
"narHash": "sha256-E4zUPEUFyVWjVm45zICaHRpfGepfkE9Z2OECV9HXfA4=",
"owner": "guibou",
"repo": "nixGL",
"rev": "489d6b095ab9d289fe11af0219a9ff00fe87c7c5",
"type": "github"
},
"original": {
"owner": "guibou",
"repo": "nixGL",
"type": "github"
}
},
"nixpkgs": { "nixpkgs": {
"locked": {
"lastModified": 1660551188,
"narHash": "sha256-a1LARMMYQ8DPx1BgoI/UN4bXe12hhZkCNqdxNi6uS0g=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "441dc5d512153039f19ef198e662e4f3dbb9fd65",
"type": "github"
},
"original": {
"owner": "nixos",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": { "locked": {
"lastModified": 1697851979, "lastModified": 1697851979,
"narHash": "sha256-lJ8k4qkkwdvi+t/Xc6Fn74kUuobpu9ynPGxNZR6OwoA=", "narHash": "sha256-lJ8k4qkkwdvi+t/Xc6Fn74kUuobpu9ynPGxNZR6OwoA=",
@ -32,7 +81,7 @@
"url": "https://flakehub.com/f/NixOS/nixpkgs/0.2305.491812.tar.gz" "url": "https://flakehub.com/f/NixOS/nixpkgs/0.2305.491812.tar.gz"
} }
}, },
"nixpkgs_2": { "nixpkgs_3": {
"locked": { "locked": {
"lastModified": 1681358109, "lastModified": 1681358109,
"narHash": "sha256-eKyxW4OohHQx9Urxi7TQlFBTDWII+F+x2hklDOQPB50=", "narHash": "sha256-eKyxW4OohHQx9Urxi7TQlFBTDWII+F+x2hklDOQPB50=",
@ -50,14 +99,15 @@
}, },
"root": { "root": {
"inputs": { "inputs": {
"nixpkgs": "nixpkgs", "nixgl": "nixgl",
"nixpkgs": "nixpkgs_2",
"rust-overlay": "rust-overlay" "rust-overlay": "rust-overlay"
} }
}, },
"rust-overlay": { "rust-overlay": {
"inputs": { "inputs": {
"flake-utils": "flake-utils", "flake-utils": "flake-utils_2",
"nixpkgs": "nixpkgs_2" "nixpkgs": "nixpkgs_3"
}, },
"locked": { "locked": {
"lastModified": 1694484610, "lastModified": 1694484610,

View File

@ -5,15 +5,17 @@
inputs = { inputs = {
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.2305.491812.tar.gz"; nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/0.2305.491812.tar.gz";
rust-overlay.url = "github:oxalica/rust-overlay"; # A helper for Rust + Nix rust-overlay.url = "github:oxalica/rust-overlay"; # A helper for Rust + Nix
nixgl.url = "github:guibou/nixGL"; # Allows you to run OpenGL and or Vulkan applications in a nix shell
}; };
# Flake outputs # Flake outputs
outputs = { self, nixpkgs, rust-overlay }: outputs = { self, nixpkgs, rust-overlay, nixgl, ... }:
let let
# Overlays enable you to customize the Nixpkgs attribute set # Overlays enable you to customize the Nixpkgs attribute set
overlays = [ overlays = [
# Makes a `rust-bin` attribute available in Nixpkgs # Makes a `rust-bin` attribute available in Nixpkgs
(import rust-overlay) (import rust-overlay)
nixgl.overlay
# Provides a `rustToolchain` attribute for Nixpkgs that we can use to # Provides a `rustToolchain` attribute for Nixpkgs that we can use to
# create a Rust environment # create a Rust environment
(self: super: { (self: super: {
@ -40,6 +42,9 @@
default = pkgs.mkShell { default = pkgs.mkShell {
# The Nix packages provided in the environment # The Nix packages provided in the environment
packages = (with pkgs; [ packages = (with pkgs; [
# Fluff
cargo-mommy
onefetch
# Bevy # Bevy
pkg-config pkg-config
alsa-lib alsa-lib
@ -50,6 +55,8 @@
udev udev
clang clang
lld lld
# If using an intel GPU
pkgs.nixgl.nixVulkanIntel
# If on x11 # If on x11
xorg.libX11 xorg.libX11
xorg.libX11 xorg.libX11
@ -68,6 +75,9 @@
pkgs.udev pkgs.udev
pkgs.vulkan-loader pkgs.vulkan-loader
]}" ]}"
alias run="nixVulkanIntel cargo run"
onefetch
echo "Welcome to nix-hell uh nix-shell!"
''; '';
}; };
}); });