From b7ca309af740b41e543cc4c2b1b7a3395a876c13 Mon Sep 17 00:00:00 2001 From: Edouard Paris Date: Tue, 24 Jun 2025 02:33:13 -0700 Subject: [PATCH] Add minimal nix development shell option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Refactor flake.nix to use shared commonBuildInputs for all shells - Add minimalShell without Rust toolchain accessible via `nix develop .#minimal` - Keep default shell with full Rust development environment - Maintains backward compatibility while providing minimal shell option 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- flake.nix | 45 ++++++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/flake.nix b/flake.nix index 4c43dd4b..0e37cef0 100644 --- a/flake.nix +++ b/flake.nix @@ -140,23 +140,34 @@ ${aarch64-apple-darwin}/aarch64-apple-darwin/liana-gui ''; + # Common build inputs for all shells + commonBuildInputs = with pkgs; [ + expat + fontconfig + freetype + freetype.dev + libGL + pkg-config + udev + wayland + libxkbcommon + xorg.libX11 + xorg.libXcursor + xorg.libXi + xorg.libXrandr + ]; + + # Minimal shell without Rust toolchain + minimalShell = pkgs.mkShell rec { + buildInputs = commonBuildInputs; + + LD_LIBRARY_PATH = + builtins.foldl' (a: b: "${a}:${b}/lib") "${pkgs.vulkan-loader}/lib" buildInputs; + }; + + # Full development shell with Rust toolchain devShell = pkgs.mkShell rec { - buildInputs = with pkgs; [ - expat - fontconfig - freetype - freetype.dev - libGL - pkg-config - udev - wayland - libxkbcommon - xorg.libX11 - xorg.libXcursor - xorg.libXi - xorg.libXrandr - toolchain - ]; + buildInputs = commonBuildInputs ++ [ toolchain ]; LD_LIBRARY_PATH = builtins.foldl' (a: b: "${a}:${b}/lib") "${pkgs.vulkan-loader}/lib" buildInputs; @@ -191,7 +202,7 @@ devShells = { - dev = devShell; + minimal = minimalShell; release = releaseShell; default = devShell; };