Skip to content

Commit

Permalink
allow overriding mkShell used
Browse files Browse the repository at this point in the history
  • Loading branch information
mibmo committed Oct 10, 2024
1 parent 77c620c commit 4bb0c45
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 { });
Expand Down
12 changes: 12 additions & 0 deletions modules/top-level.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit 4bb0c45

Please sign in to comment.