mirror of
https://github.com/ryan4yin/nixos-and-flakes-book
synced 2024-12-19 00:43:08 +00:00
1.5 KiB
1.5 KiB
Nixpkgs's Advanced Usage
callPackage
, Overriding
, and Overlays
are the techniques occasionally used when using Nix to customize the build method of Nix packages.
We know that many programs have a large number of build parameters that need to be configured, and different users may want to use different build parameters. This is where Overriding
and Overlays
come in handy. Let me give you a few examples I have encountered:
fcitx5-rime.nix
: By default,fcitx5-rime
userime-data
as the value ofrimeDataPkgs
, but this parameter can be customized byoverride
.vscode/with-extensions.nix
: This package for VS Code can also be customized by overriding the value ofvscodeExtensions
, thus we can install some custom plugins into VS Code.nix-vscode-extensions
: This is a vscode plugin manager implemented by overridingvscodeExtensions
.
firefox/common.nix
: Firefox has many customizable parameters too.- ...
In short, callPackage
, Overriding
and Overlays
can be used to customize the build parameters of Nix packages.