1# Hy {#sec-language-hy}
2
3## Installation {#ssec-hy-installation}
4
5### Installation without packages {#installation-without-packages}
6
7You can install `hy` via nix-env or by adding it to `configuration.nix` by referring to it as a `hy` attribute. This kind of installation adds `hy` to your environment and it successfully works with `python3`.
8
9::: {.caution}
10Packages that are installed with your python derivation, are not accessible by `hy` this way.
11:::
12
13### Installation with packages {#installation-with-packages}
14
15Creating a `hy` derivation with custom `python` packages is really simple and similar to the way that python does it. The attribute `hy` provides the function `withPackages` that creates a custom `hy` derivation with specified packages.
16
17For example, if you want to create a shell with `matplotlib` and `numpy`, you can do it like so:
18
19```ShellSession
20$ nix-shell -p "hy.withPackages (ps: with ps; [ numpy matplotlib ])"
21```
22
23Or if you want to extend your `configuration.nix`:
24```nix
25{
26 # ...
27
28 environment.systemPackages = with pkgs; [
29 (hy.withPackages (
30 py-packages: with py-packages; [
31 numpy
32 matplotlib
33 ]
34 ))
35 ];
36}
37```