From fe41b3e7608c38ffa136e40c207d068a2b805998 Mon Sep 17 00:00:00 2001 From: Rotem Horesh <148942120+rotmh@users.noreply.github.com> Date: Thu, 30 Jan 2025 22:37:49 +0200 Subject: Add a flake for a dev shell --- DEPENDENCIES.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'DEPENDENCIES.md') diff --git a/DEPENDENCIES.md b/DEPENDENCIES.md index 87fd8c7c..6ae9995e 100644 --- a/DEPENDENCIES.md +++ b/DEPENDENCIES.md @@ -33,3 +33,49 @@ pkgs.mkShell rec { builtins.foldl' (a: b: "${a}:${b}/lib") "${pkgs.vulkan-loader}/lib" buildInputs; } ``` + +Alternatively, you can use this `flake.nix` to create a dev shell, activated by `nix develop`: + +```nix +{ + inputs = { + nixpkgs.url = "nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + }; + + outputs = { + nixpkgs, + flake-utils, + ... + }: + flake-utils.lib.eachDefaultSystem ( + system: let + pkgs = import nixpkgs { + inherit system; + }; + + buildInputs = with pkgs; [ + expat + fontconfig + freetype + freetype.dev + libGL + pkg-config + xorg.libX11 + xorg.libXcursor + xorg.libXi + xorg.libXrandr + wayland + libxkbcommon + ]; + in { + devShells.default = pkgs.mkShell { + inherit buildInputs; + + LD_LIBRARY_PATH = + builtins.foldl' (a: b: "${a}:${b}/lib") "${pkgs.vulkan-loader}/lib" buildInputs; + }; + } + ); +} +``` -- cgit