nix-ai/modules/wvls.nix
2024-07-15 23:48:47 +02:00

20 lines
771 B
Nix

{ pkgs, buildPackages, ... }: let
makePythonWriter = python: pythonPackages: buildPythonPackages: name: { libraries ? [], flakeIgnore ? [], ... } @ args: pkgs.writers.makeScriptWriter (
(builtins.removeAttrs args ["libraries" "flakeIgnore"]) // {
interpreter =
if pythonPackages != pkgs.pypy2Packages || pythonPackages != pkgs.pypy3Packages then
if libraries == []
then python.interpreter
else (python.withPackages (ps: libraries)).interpreter
else python.interpreter;
}
) name;
in
makePythonWriter pkgs.python3 pkgs.python3Packages buildPackages.python3Packages "/bin/wvls" {
libraries = with pkgs.python3Packages; [
gitpython
keyring
requests
];
} (builtins.readFile ./../scripts/wvls.py)