mirror of
https://github.com/foo-dogsquared/wiki.git
synced 2025-01-30 22:57:59 +00:00
5242780327
Added more notes as I developed the Guix overlay for NixOS over time. It does have a nice experience, overall (albeit clunky one due to the documentation).
1.6 KiB
1.6 KiB
nixpkgs setup hooks
Setup hooks are additional steps given from a package typically written as a shell script.
They are usually defined in a package with common build steps that would otherwise be repeated on a lot of packages such as…
- Meson where it gives common arguments such as the GNU directory variables relative to the output from the derivation (i.e.,
out
). - Guile where it set up different search paths related to GNU Guile.
- Python also works similarly to Guile's only with a lot more of setup hooks for building and wrapping programs build with Python as it is used for various functions (e.g.,
buildPythonPackage
,buildPythonApplication
).
You can see more setup hooks example at pkgs/build-support/setup-hooks
from roam:nixpkgs.
- Adding a setup hook is made with
setupHook
attribute fromstdenv.mkDerivation
where it needs either a path or a derivation. - You could also make a setup hook with additional environment with
makeSetupHook
function.