this post was submitted on 14 Jan 2026
2 points (100.0% liked)

Nix / NixOS

2593 readers
1 users here now

Main links

Videos

founded 2 years ago
MODERATORS
 

I'm currently trying to package a python package called entangled.py, two of its dependencies aren't in the nixpkgs so I also packaged them. Now I'm trying to package the entangled with these two local packages but idk how to actually use them, rn i do this (using buildPythonPackage):

buildPythonPackage rec {
  # ...
  dependencies = [
    py
    filelock
    rich
    rich-argparse
    tomlkit
    copier
    (callPackage ../brei/package.nix)
    pyyaml
    (callPackage ../repl-session/package.nix)
    msgspec
    click
    rich-click
    typeguard
    watchfiles
  ];
  # ...
}

but it returns me this error:

error:
       … while evaluating the attribute 'drvPath'
         at /nix/store/ln4j1iqnnzs2ynx2cr88bdh65fmds2aq-source/lib/customisation.nix:446:7:
          445|     // {
          446|       drvPath =
             |       ^
          447|         assert condition;

       … while calling the 'derivationStrict' builtin
         at <nix/derivation-internal.nix>:37:12:
           36|
           37|   strict = derivationStrict drvAttrs;
             |            ^
           38|

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: Dependency is not of a valid type: element 7 of propagatedBuildInputs for python3.13-entangled-cli-2.4.

obviously this is only for testing if the package builds and works correctly, i don't want to send a broken package

SOLUTION: kinda stupid of me lol, i need to add an empty set after the path like so: (callPackage path/to/package { }) also if u're using with import <nixpkgs>;, remove that too

top 2 comments
sorted by: hot top controversial new old
[–] hallettj@leminal.space 1 points 1 week ago (1 children)

With callPackage you need to specify an argument set to the package expression, like this:

callPackage ../brei/package.nix {}

Without the curly braces what you have is a function instead of a derivation, which is why the error message says it's an invalid type.

The argument set lets you override inputs to the package set, or pass in arguments that aren't provided by nixpkgs. But if you want all package inputs to be automatically pulled from nixpkgs then you provide an empty set.

[–] claymorwan@lemmy.blahaj.zone 2 points 1 week ago

yea i was abt to edit the post saying i found out lol, but still thanks for the help