diff options
author | Luke Granger-Brown <git@lukegb.com> | 2021-06-30 23:03:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-30 23:03:13 +0100 |
commit | e8d4f67e8af80a7176385a4f2f6d726afe64f093 (patch) | |
tree | f8debd4e3c568f121ba4a3d99b697231847d32c9 /doc | |
parent | 0a876d91cb8b156b77fc15de110a904f2acaa78b (diff) | |
parent | 30a15dbc5e6c891feade4c32478e36827190fe14 (diff) | |
download | nixpkgs-e8d4f67e8af80a7176385a4f2f6d726afe64f093.tar nixpkgs-e8d4f67e8af80a7176385a4f2f6d726afe64f093.tar.gz nixpkgs-e8d4f67e8af80a7176385a4f2f6d726afe64f093.tar.bz2 nixpkgs-e8d4f67e8af80a7176385a4f2f6d726afe64f093.tar.lz nixpkgs-e8d4f67e8af80a7176385a4f2f6d726afe64f093.tar.xz nixpkgs-e8d4f67e8af80a7176385a4f2f6d726afe64f093.tar.zst nixpkgs-e8d4f67e8af80a7176385a4f2f6d726afe64f093.zip |
Merge pull request #128123 from Mazurel/master
hy: 0.19.0 -> 1.0a1 and improvements
Diffstat (limited to 'doc')
-rw-r--r-- | doc/languages-frameworks/hy.section.md | 31 | ||||
-rw-r--r-- | doc/languages-frameworks/index.xml | 1 |
2 files changed, 32 insertions, 0 deletions
diff --git a/doc/languages-frameworks/hy.section.md b/doc/languages-frameworks/hy.section.md new file mode 100644 index 00000000000..a851ff24dfc --- /dev/null +++ b/doc/languages-frameworks/hy.section.md @@ -0,0 +1,31 @@ +# Hy {#sec-language-hy} + +## Installation {#ssec-hy-installation} + +### Installation without packages {#installation-without-packages} + +You can install `hy` via nix-env or by adding it to `configuration.nix` by reffering to it as a `hy` attribute. This kind of installation adds `hy` to your environment and it succesfully works with `python3`. + +::: {.caution} +Packages that are installed with your python derivation, are not accesible by `hy` this way. +::: + +### Installation with packages {#installation-with-packages} + +Creating `hy` derivation with custom `python` packages is really simple and similar to the way that python does it. Attribute `hy` provides function `withPackages` that creates custom `hy` derivation with specified packages. + +For example if you want to create shell with `matplotlib` and `numpy`, you can do it like so: + +```ShellSession +$ nix-shell -p "hy.withPackages (ps: with ps; [ numpy matplotlib ])" +``` + +Or if you want to extend your `configuration.nix`: +```nix +{ # ... + + environment.systemPackages = with pkgs; [ + (hy.withPackages (py-packages: with py-packages; [ numpy matplotlib ])) + ]; +} +``` diff --git a/doc/languages-frameworks/index.xml b/doc/languages-frameworks/index.xml index 791afce6f5c..516bddf67fd 100644 --- a/doc/languages-frameworks/index.xml +++ b/doc/languages-frameworks/index.xml @@ -16,6 +16,7 @@ <xi:include href="gnome.section.xml" /> <xi:include href="go.section.xml" /> <xi:include href="haskell.section.xml" /> + <xi:include href="hy.section.xml" /> <xi:include href="idris.section.xml" /> <xi:include href="ios.section.xml" /> <xi:include href="java.section.xml" /> |