diff --git a/lib.nix b/lib.nix index 525940e..d390997 100644 --- a/lib.nix +++ b/lib.nix @@ -17,7 +17,7 @@ let } // config.flake; mkShell = config: pkgs: system: - pkgs.mkShell { + config.mkShell { packages = config.packages ++ [ config.formatter ]; LD_LIBRARY_PATH = makeLibraryPath config.libraries; inputsFrom = attrValues (config.flake.packages.${system} or { }); diff --git a/modules/top-level.nix b/modules/top-level.nix index 5f96c7c..e88ee96 100644 --- a/modules/top-level.nix +++ b/modules/top-level.nix @@ -69,6 +69,18 @@ in This is mainly for conch modules; shellHook should generally be used instead. ''; }; + + mkShell = mkOption { + # can't represent `f :: set -> drv` with option type system + type = with types; anything; + default = pkgs.mkShell; + example = [ "craneLib.devShell" ]; + description = mdDoc '' + A function compatible with `pkgs.mkShell`, to allow arbitrary extending of use-case. + + Specifically made for crane's `craneLib.devShell`. + ''; + }; }; config._module = {