From 658dfcf5b097f8c26400b7c2092b30ccc7f078f2 Mon Sep 17 00:00:00 2001 From: Shivaraj B H Date: Mon, 26 Jun 2023 21:51:46 +0530 Subject: [PATCH] Add `benchmark` and `hoogle` devShell options (#175) --- CHANGELOG.md | 1 + nix/modules/project/devshell.nix | 23 ++++++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90cebe4..7befd6e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - Add `project.config.defaults.settings.default` defining sensible defaults for local packages. - Add `project.config.defaults.enable` to turn off all default settings en masse. - Regressions in this PR: #169, #178 +- #175: `devShell`: Add options `benchmark` (to enable benchmark dependencies) and `hoogle` (whether to include Hoogle in development shell) ## 0.3.0 (May 22, 2023) diff --git a/nix/modules/project/devshell.nix b/nix/modules/project/devshell.nix index 998445c..c8867f7 100644 --- a/nix/modules/project/devshell.nix +++ b/nix/modules/project/devshell.nix @@ -57,6 +57,26 @@ let }; ''; }; + + benchmark = mkOption { + type = types.bool; + description = '' + Whether to include benchmark dependencies in the development shell. + The value of this option will set the corresponding `doBenchmark` flag in the + `shellFor` derivation. + ''; + default = false; + }; + + hoogle = mkOption { + type = types.bool; + default = true; + description = '' + Whether to include Hoogle in the development shell. + The value of this option will set the corresponding `withHoogle` flag in the + `shellFor` derivation. + ''; + }; }; }; in @@ -99,7 +119,8 @@ in map (name: p."${name}") (lib.attrNames localPackages); - withHoogle = true; + withHoogle = config.devShell.hoogle; + doBenchmark = config.devShell.benchmark; extraDependencies = p: let o = mkShellArgs.extraDependencies or (_: { }) p; in o // {