I’m trying to set up a python development environment with poetry2nix and nix flakes. I need a cli tool called pros-cli not packaged for nixos, and this seems like this best way to do it. Here is my flake.nix:
{
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.nixpkgs.url = "github:NixOS/nixpkgs";
inputs.poetry2nix.url = "github:nix-community/poetry2nix";
outputs = { self, nixpkgs, flake-utils, poetry2nix }:
(flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
};
pythonEnv = poetry2nix.mkPoetryEnv {
projectDir = ./.;
};
in
rec {
devShell = pkgs.mkShell {
buildInputs = [
pythonEnv
];
};
}));
}
However when direnv try to run the nix-shell it throws this error:
error: attribute 'mkPoetryEnv' missing
at /nix/store/a9cfqjap3jl7h6x9magnr433rm6vwr26-source/flake.nix:12:21:
11| };
12| pythonEnv = poetry2nix.mkPoetryEnv {
| ^
13| projectDir = ./.;
My pyproject.toml file looks like this:
[tool.poetry]
name = "prosTest"
version = "0.1.0"
description = "a test env for vex robotics development"
authors = ["BattleCh1cken <BattleCh1cken@Larkov.de>"]
license = "gpl"
[tool.poetry.dependencies]
python = "^3.10"
pros-cli = "^3.3.3"
[tool.poetry.dev-dependencies]
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
111
I’m not sure why this doesn’t work. This shell.nix for qmk seems to do something similar and it works just fine for me: