2024-09-02 13:21:01 +02:00
|
|
|
{ inputs, ... }:
|
|
|
|
|
2023-12-29 15:42:26 +01:00
|
|
|
{
|
|
|
|
perSystem =
|
2024-09-02 13:21:01 +02:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
system,
|
|
|
|
...
|
|
|
|
}:
|
2023-12-29 15:42:26 +01:00
|
|
|
{
|
|
|
|
devShells =
|
2024-09-02 13:21:01 +02:00
|
|
|
let
|
|
|
|
pkgs = import inputs.nixpkgs { inherit system; };
|
|
|
|
stdenv = pkgs.stdenv;
|
|
|
|
scripts = config.packages.python-scripts;
|
|
|
|
in
|
|
|
|
lib.pipe (config.packages) [
|
|
|
|
(lib.concatMapAttrs (
|
|
|
|
name: package: {
|
|
|
|
${name} = pkgs.mkShell {
|
|
|
|
name = "${name}";
|
|
|
|
inputsFrom = [ package ];
|
|
|
|
shellHook = ''
|
|
|
|
echo "Entering ${name} devShell"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
"${name}-extra" =
|
|
|
|
if (name == "python-scripts") then
|
|
|
|
null
|
|
|
|
else
|
|
|
|
pkgs.mkShell {
|
|
|
|
name = "${name}-extra";
|
|
|
|
inputsFrom = [
|
|
|
|
package
|
|
|
|
scripts
|
|
|
|
];
|
|
|
|
# Extra packages that *may* be used by some scripts
|
|
|
|
packages = [
|
|
|
|
pkgs.python3Packages.tiktoken
|
|
|
|
];
|
|
|
|
shellHook = ''
|
|
|
|
echo "Entering ${name} devShell"
|
|
|
|
addToSearchPath "LD_LIBRARY_PATH" "${lib.getLib stdenv.cc.cc}/lib"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
}
|
|
|
|
))
|
|
|
|
(lib.filterAttrs (name: value: value != null))
|
|
|
|
];
|
2023-12-29 15:42:26 +01:00
|
|
|
};
|
|
|
|
}
|