From 363a8f403699be50036b37fa2c6b854910bccbf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9ana=20=E6=B1=9F?= Date: Fri, 4 Jul 2025 17:36:33 +0200 Subject: [PATCH] shell: use nix-shell args to call This makes the different shell options easier to compose with --- shell.nix | 45 +++++++++++++++++++++------------------------ 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/shell.nix b/shell.nix index d7f54c4b..019d92c8 100644 --- a/shell.nix +++ b/shell.nix @@ -7,27 +7,24 @@ ./nix/packages/overlay.nix ]; }, -}: rec { - default = pkgs.mkShell { - packages = with pkgs; [ - just - jq - npins - disko - ]; - }; - - withXMonad = pkgs.mkShell { - inputsFrom = [ - default - ]; - packages = with pkgs; [ - (haskellPackages.ghcWithPackages (self: [ - self.xmonad-contrib - self.xmonad-extras - ])) - haskell-language-server - cabal-install - ]; - }; -} + withXMonad ? false, +}: let + inherit (pkgs) lib; +in + pkgs.mkShell { + packages = with pkgs; + [ + just + jq + npins + disko + ] + ++ lib.optionals withXMonad [ + (haskellPackages.ghcWithPackages (self: [ + self.xmonad-contrib + self.xmonad-extras + ])) + haskell-language-server + cabal-install + ]; + }