From 3cef7f2dc5f0482f76b063193c892b5b065a136e Mon Sep 17 00:00:00 2001 From: Ross W Date: Thu, 14 Aug 2025 21:45:48 +0100 Subject: [PATCH] Nix flake --- .gitignore | 2 -- flake.lock | 27 +++++++++++++++++++++++++++ flake.nix | 29 +++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/.gitignore b/.gitignore index e65ff92..e030d92 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,3 @@ target/ .classpath .project -flake.nix -flake.lock diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..f26f4a6 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1755027561, + "narHash": "sha256-IVft239Bc8p8Dtvf7UAACMG5P3ZV+3/aO28gXpGtMXI=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "005433b926e16227259a1843015b5b2b7f7d1fc3", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..2b3394e --- /dev/null +++ b/flake.nix @@ -0,0 +1,29 @@ +{ + description = "LWJGL Wayland + nvidia bullshit"; + + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + }; + + outputs = { self, nixpkgs }: + let + system = "x86_64-linux"; + pkgs = import nixpkgs { + inherit system; + config.allowUnfree = true; + }; + in + { + devShells.${system}.default = pkgs.mkShell { + shellHook = with pkgs; '' + export LD_LIBRARY_PATH=${pkgs.lib.makeLibraryPath [ + wayland + libxkbcommon + libGL + ]}:$LD_LIBRARY_PATH + + export __GL_THREADED_OPTIMIZATIONS=0 + ''; + }; + }; +}