-
-
Notifications
You must be signed in to change notification settings - Fork 15
NPV 127
Philip Taron edited this page Feb 16, 2026
·
1 revision
Nix files under pkgs/by-name must not contain absolute path expressions (paths starting with /). Absolute paths are machine-specific and not allowed in Nixpkgs.
{relative_package_dir}: File {subpath} at line {line} contains the absolute path expression "{text}", which is not allowed in nixpkgs.
Given pkgs/by-name/aa/aa/package.nix:
{ someDrv }: someDrv // { escape = /foo; }The error is:
pkgs/by-name/aa/aa: File package.nix at line 1 contains the absolute path expression "/foo", which is not allowed in nixpkgs.
Remove the absolute path. Use relative paths within the package directory, or pass the path as a callPackage argument. If you need to reference a system path at build time, use a string instead (e.g., "/foo" as a string, not /foo as a Nix path).