I have this flake.nix
{
description = "dspy test";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.dspy = {
url = "github:stanfordnlp/dspy";
flake = false;
};
outputs = { self, nixpkgs, flake-utils,dspy }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
python = pkgs.python312;
python_packages = python.withPackages(ps: with ps;[
ipython
matplotlib
pandas
pip
dspy
]);
myDevTools = [
python_packages
];
in {
devShells.default = pkgs.mkShell {
buildInputs = myDevTools;
};
});
}
I use the command nix develop
to create a virtual environment. I open a python terminal. I enter import dspi
and it works.
But I don’t understand why it works.
THe documentation only say that:
Repositories that don’t contain a flake.nix can also be used as
inputs, by setting the input’s flake attribute to false:
but it doesn’t explain how it is built