Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Post History

71%
+3 −0
Q&A What does Nixpkgs' `callPackage` do?

callPackage is a complex function (reasons include the Nix language being lazy, usage of fixed-point evaluation, overrides, etc.), and this complexity steals the spotlight from what this function a...

1 answer  ·  posted 3mo ago by toraritte‭  ·  edited 3mo ago by toraritte‭

Question *nix nixpkgs
#3: Post edited by user avatar toraritte‭ · 2024-08-12T15:17:45Z (3 months ago)
  • There are a plethora of online resources about this topic (see below), but I need this one explained to me like I'm 5 every time a I take at least a month off working with Nix.
  • The aforementioned resources:
  • + \[`nix.dev`] [Package parameters and overrides with callPackage — nix.dev documentation](https://nix.dev/tutorials/callpackage)
  • + \[`Nix Pills`] [13. Callpackage Design Pattern](https://nixos.org/guides/nix-pills/13-callpackage-design-pattern)
  • + \[`Nix-Book`] [Imports and callPackage - Nix-Book](https://book.divnix.com/ch05-03-imports-and-callpackage.html)
  • + [Nixpkgs commit][1] and [email][2] introducing `callPackage`
  • + \[`stackoverflow`] [Where is `callPackage` defined in the Nixpkgs repo (or how to find Nix lambda definitions in general)?](https://stackoverflow.com/questions/56121361/where-is-callpackage-defined-in-the-nixpkgs-repo-or-how-to-find-nix-lambda-de)
  • + \[`NixOS Discourse`] [Where is `callPackage` defined exactly? (part 2) - Help - NixOS Discourse](https://discourse.nixos.org/t/where-is-callpackage-defined-exactly-part-2/12524)
  • + \[`Nixpkgs repo`] [Issue #36354 - Document what callPackage does and its preconditions](https://github.com/NixOS/nixpkgs/issues/36354)
  • + \[`Summer of Nix`] [`callPackage`, a tool for the lazy](https://summer.nixos.org/blog/callpackage-a-tool-for-the-lazy/)
  • + \[`NixOS & Flakes Book`] [`pkgs.callPackage`](https://nixos-and-flakes.thiscute.world/nixpkgs/callpackage)
  • [1]: https://github.com/nixos/nixpkgs/commit/d17f0f9cbca38fabb71624f069cd4c0d6feace92
  • [2]: https://www.mail-archive.com/nix-dev@cs.uu.nl/msg02624.html
  • `callPackage` is a complex function (reasons include the Nix language being lazy, usage of fixed-point evaluation, overrides, etc.), and this complexity steals the spotlight from what this function actually does and why is it so useful.
  • There are a plethora of online resources about this topic (see below), but I couldn't find a simple, concise summary.
  • + \[`nix.dev`] [Package parameters and overrides with callPackage — nix.dev documentation](https://nix.dev/tutorials/callpackage)
  • + \[`Nix Pills`] [13. Callpackage Design Pattern](https://nixos.org/guides/nix-pills/13-callpackage-design-pattern)
  • + \[`Nix-Book`] [Imports and callPackage - Nix-Book](https://book.divnix.com/ch05-03-imports-and-callpackage.html)
  • + [Nixpkgs commit][1] and [email][2] introducing `callPackage`
  • + \[`stackoverflow`] [Where is `callPackage` defined in the Nixpkgs repo (or how to find Nix lambda definitions in general)?](https://stackoverflow.com/questions/56121361/where-is-callpackage-defined-in-the-nixpkgs-repo-or-how-to-find-nix-lambda-de)
  • + \[`NixOS Discourse`] [Where is `callPackage` defined exactly? (part 2) - Help - NixOS Discourse](https://discourse.nixos.org/t/where-is-callpackage-defined-exactly-part-2/12524)
  • + \[`Nixpkgs repo`] [Issue #36354 - Document what callPackage does and its preconditions](https://github.com/NixOS/nixpkgs/issues/36354)
  • + \[`Summer of Nix`] [`callPackage`, a tool for the lazy](https://summer.nixos.org/blog/callpackage-a-tool-for-the-lazy/)
  • + \[`NixOS & Flakes Book`] [`pkgs.callPackage`](https://nixos-and-flakes.thiscute.world/nixpkgs/callpackage)
  • [1]: https://github.com/nixos/nixpkgs/commit/d17f0f9cbca38fabb71624f069cd4c0d6feace92
  • [2]: https://www.mail-archive.com/nix-dev@cs.uu.nl/msg02624.html
#2: Post edited by user avatar toraritte‭ · 2024-08-12T01:34:28Z (3 months ago)
  • There are a plethora of online resources about this topic (see below), but I need this one explained to me like I'm 5 every time a I take at least a month off working with Nix.
  • The aforementioned resources:
  • + \[`nix.dev`] [Package parameters and overrides with callPackage — nix.dev documentation](https://nix.dev/tutorials/callpackage)
  • + \[`Nix Pills`] [13. Callpackage Design Pattern](https://nixos.org/guides/nix-pills/13-callpackage-design-pattern)
  • + \[`Nix-Book`] [Imports and callPackage - Nix-Book](https://book.divnix.com/ch05-03-imports-and-callpackage.html)
  • + [Nixpkgs commit][1] and [email][2] introducing `callPackage`
  • + \[`stackoverflow`] [Where is `callPackage` defined in the Nixpkgs repo (or how to find Nix lambda definitions in general)?](https://stackoverflow.com/questions/56121361/where-is-callpackage-defined-in-the-nixpkgs-repo-or-how-to-find-nix-lambda-de)
  • + \[`NixOS Discourse`] [Where is `callPackage` defined exactly? (part 2) - Help - NixOS Discourse](https://discourse.nixos.org/t/where-is-callpackage-defined-exactly-part-2/12524)
  • + \[`Nixpkgs repo`] [Issue #36354 - Document what callPackage does and its preconditions](https://github.com/NixOS/nixpkgs/issues/36354)
  • + \[`Summer of Nix`] [`callPackage`, a tool for the lazy](https://summer.nixos.org/blog/callpackage-a-tool-for-the-lazy/)
  • [1]: https://github.com/nixos/nixpkgs/commit/d17f0f9cbca38fabb71624f069cd4c0d6feace92
  • [2]: https://www.mail-archive.com/nix-dev@cs.uu.nl/msg02624.html
  • There are a plethora of online resources about this topic (see below), but I need this one explained to me like I'm 5 every time a I take at least a month off working with Nix.
  • The aforementioned resources:
  • + \[`nix.dev`] [Package parameters and overrides with callPackage — nix.dev documentation](https://nix.dev/tutorials/callpackage)
  • + \[`Nix Pills`] [13. Callpackage Design Pattern](https://nixos.org/guides/nix-pills/13-callpackage-design-pattern)
  • + \[`Nix-Book`] [Imports and callPackage - Nix-Book](https://book.divnix.com/ch05-03-imports-and-callpackage.html)
  • + [Nixpkgs commit][1] and [email][2] introducing `callPackage`
  • + \[`stackoverflow`] [Where is `callPackage` defined in the Nixpkgs repo (or how to find Nix lambda definitions in general)?](https://stackoverflow.com/questions/56121361/where-is-callpackage-defined-in-the-nixpkgs-repo-or-how-to-find-nix-lambda-de)
  • + \[`NixOS Discourse`] [Where is `callPackage` defined exactly? (part 2) - Help - NixOS Discourse](https://discourse.nixos.org/t/where-is-callpackage-defined-exactly-part-2/12524)
  • + \[`Nixpkgs repo`] [Issue #36354 - Document what callPackage does and its preconditions](https://github.com/NixOS/nixpkgs/issues/36354)
  • + \[`Summer of Nix`] [`callPackage`, a tool for the lazy](https://summer.nixos.org/blog/callpackage-a-tool-for-the-lazy/)
  • + \[`NixOS & Flakes Book`] [`pkgs.callPackage`](https://nixos-and-flakes.thiscute.world/nixpkgs/callpackage)
  • [1]: https://github.com/nixos/nixpkgs/commit/d17f0f9cbca38fabb71624f069cd4c0d6feace92
  • [2]: https://www.mail-archive.com/nix-dev@cs.uu.nl/msg02624.html
#1: Initial revision by user avatar toraritte‭ · 2024-08-12T00:22:47Z (3 months ago)
What does Nixpkgs' `callPackage` do?
There are a plethora of online resources about this topic (see below), but I need this one explained to me like I'm 5 every time a I take at least a month off working with Nix.

The aforementioned resources:

+ \[`nix.dev`] [Package parameters and overrides with callPackage — nix.dev documentation](https://nix.dev/tutorials/callpackage)
+ \[`Nix Pills`] [13. Callpackage Design Pattern](https://nixos.org/guides/nix-pills/13-callpackage-design-pattern)
+ \[`Nix-Book`] [Imports and callPackage - Nix-Book](https://book.divnix.com/ch05-03-imports-and-callpackage.html)
+ [Nixpkgs commit][1] and [email][2] introducing `callPackage`
+ \[`stackoverflow`] [Where is `callPackage` defined in the Nixpkgs repo (or how to find Nix lambda definitions in general)?](https://stackoverflow.com/questions/56121361/where-is-callpackage-defined-in-the-nixpkgs-repo-or-how-to-find-nix-lambda-de)
+ \[`NixOS Discourse`] [Where is `callPackage` defined exactly? (part 2) - Help - NixOS Discourse](https://discourse.nixos.org/t/where-is-callpackage-defined-exactly-part-2/12524)
+ \[`Nixpkgs repo`] [Issue #36354 - Document what callPackage does and its preconditions](https://github.com/NixOS/nixpkgs/issues/36354)
+ \[`Summer of Nix`] [`callPackage`, a tool for the lazy](https://summer.nixos.org/blog/callpackage-a-tool-for-the-lazy/)


  [1]: https://github.com/nixos/nixpkgs/commit/d17f0f9cbca38fabb71624f069cd4c0d6feace92
  [2]: https://www.mail-archive.com/nix-dev@cs.uu.nl/msg02624.html