2022-03-21 22:41:18 +02:00
|
|
|
{ inputs, pkgs, ... }:
|
|
|
|
let
|
|
|
|
inherit (pkgs) system;
|
|
|
|
|
|
|
|
inherit (inputs.devshell.legacyPackages.${system}) mkShell;
|
|
|
|
|
2022-03-21 22:42:02 +02:00
|
|
|
wrapInAttrs = value: if builtins.isAttrs value then value else { inherit value; };
|
|
|
|
|
|
|
|
injectAttrName = name: value: { inherit name; } // wrapInAttrs value;
|
2022-03-21 22:41:18 +02:00
|
|
|
|
|
|
|
mkNamedAttrs = builtins.mapAttrs injectAttrName;
|
|
|
|
|
|
|
|
attrsToNamedList = attrs: builtins.attrValues (mkNamedAttrs attrs);
|
|
|
|
in
|
|
|
|
{
|
|
|
|
packages ? [],
|
|
|
|
commands ? {},
|
|
|
|
env ? {},
|
|
|
|
config ? {}
|
|
|
|
}:
|
|
|
|
mkShell {
|
|
|
|
imports = [
|
|
|
|
config
|
|
|
|
{
|
|
|
|
inherit packages;
|
|
|
|
commands = attrsToNamedList commands;
|
|
|
|
env = attrsToNamedList env;
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|