mirror of
https://github.com/ryan4yin/nixos-and-flakes-book
synced 2024-11-23 04:33:08 +00:00
feat: callpackage
This commit is contained in:
parent
848228a9bb
commit
5c1ef28b43
1 changed files with 1 additions and 1 deletions
|
@ -92,7 +92,7 @@ In the previous example without `pkgs.callPackage`, we directly passed `pkgs` as
|
|||
# ......
|
||||
```
|
||||
|
||||
In essence, `pkgs.callPackage` is used as `pkgs.callPackage fn args`, where `fn` is a Nix file or function, and `args` is an attribute set. Here's how it works:
|
||||
In essence, `pkgs.callPackage` is used as `pkgs.callPackage fn args`, where the place holder `fn` is a Nix file or function, and `args` is an attribute set. Here's how it works:
|
||||
|
||||
1. `pkgs.callPackge fn args` first checks if `fn` is a function or a file. If it's a file, it imports the function defined within.
|
||||
1. After this step, you have a function, typically with parameters like `lib`, `stdenv`, `fetchurl`, and possibly some custom parameters.
|
||||
|
|
Loading…
Reference in a new issue