packages/lib: devshell tools

This commit is contained in:
Max Headroom 2022-03-21 23:10:20 +01:00
parent 2c897db439
commit 4e9296656e

View file

@ -6,6 +6,8 @@ let
wrapInAttrs = value: if builtins.isAttrs value then value else { inherit value; }; wrapInAttrs = value: if builtins.isAttrs value then value else { inherit value; };
wrapPackage = package: { inherit package; };
injectAttrName = name: value: { inherit name; } // wrapInAttrs value; injectAttrName = name: value: { inherit name; } // wrapInAttrs value;
mkNamedAttrs = builtins.mapAttrs injectAttrName; mkNamedAttrs = builtins.mapAttrs injectAttrName;
@ -14,6 +16,7 @@ let
in in
{ {
packages ? [], packages ? [],
tools ? [],
commands ? {}, commands ? {},
env ? {}, env ? {},
config ? {} config ? {}
@ -21,6 +24,9 @@ in
mkShell { mkShell {
imports = [ imports = [
config config
{
commands = map wrapPackage tools;
}
{ {
inherit packages; inherit packages;
commands = attrsToNamedList commands; commands = attrsToNamedList commands;