Compare commits

..

274 Commits

Author SHA1 Message Date
Jonathan Ringer
7e9b0dff97 nixos/release-notes: move non-highlights to other mentions
(cherry picked from commit 9a3e8699976bd673f9f4eee64e254ccb7a1fadce)
2021-05-31 20:06:55 -07:00
Jonathan Ringer
a8eeea419e nixos/release-notes: Initial grooming of release notes
(cherry picked from commit f15d286aaca6f7bd9f246c72978992ea8bb73e63)
2021-05-31 20:06:55 -07:00
Jonathan Ringer
9e2c334e52 nixos/doc/releases: update stable release info to 21.05
(cherry picked from commit 545ba18df2ca2077d6c1a69e02648ad88dd5d968)
2021-05-31 20:06:32 -07:00
Martin Weinelt
3a2e0c36e7 Merge pull request #125134 from NixOS/backport-124950-to-release-21.05
[Backport release-21.05] nixos/acme: don't use --reuse-key
2021-06-01 01:17:42 +02:00
Vincent Bernat
cbe0e663ec nixos/acme: don't use --reuse-key
Reusing the same private/public key on renewal has two issues:

 - some providers don't accept to sign the same public key
   again (Buypass Go SSL)

 - keeping the same private key forever partly defeats the purpose of
   renewing the certificate often

Therefore, let's remove this option. People wanting to keep the same
key can set extraLegoRenewFlags to `[ --reuse-key ]` to keep the
previous behavior. Alternatively, we could put this as an option whose
default value is true.

(cherry picked from commit 632c8e1d54)
2021-05-31 23:02:21 +00:00
Jonathan Ringer
75f90eedcf Merge pull request #124341 from NixOS/staging-next-21.05
[21.05] Staging next
2021-05-31 13:50:08 -07:00
Jonathan Ringer
7b601ada77 Merge remote-tracking branch 'origin/release-21.05' into staging-next-21.05 2021-05-31 12:44:56 -07:00
Martin Weinelt
0c2e856ea0 Merge pull request #125094 from NixOS/backport-124446-to-release-21.05
[Backport release-21.05] weechatScripts.wee-slack: 2.7.0 -> 2.8.0
2021-05-31 18:53:03 +02:00
Robert Scott
1c27669fea Merge pull request #125045 from NixOS/backport-124802-to-release-21.05
[Backport release-21.05] tilt: 0.18.10 -> 0.20.5
2021-05-31 17:50:30 +01:00
Robert Scott
ab98a6e109 Merge pull request #125057 from NixOS/backport-124730-to-release-21.05
[Backport release-21.05] morph: 1.5.0 -> 1.6.0
2021-05-31 15:53:49 +01:00
Robert Scott
1293a26299 Merge pull request #125058 from NixOS/backport-124762-to-release-21.05
[Backport release-21.05] tailscale: 1.8.5 -> 1.8.6
2021-05-31 15:48:02 +01:00
Robert Scott
cdf6c6106b Merge pull request #125056 from NixOS/backport-124702-to-release-21.05
[Backport release-21.05] fioctl: 0.16 -> 0.17
2021-05-31 15:42:31 +01:00
Martin Weinelt
9bbf2ec131 weechatScripts.wee-slack: 2.7.0 -> 2.8.0
https://github.com/wee-slack/wee-slack/releases/tag/v2.8.0
(cherry picked from commit d7de7087fc)
2021-05-31 14:21:13 +00:00
Maximilian Bosch
9130b8c465 Merge pull request #125085 from NixOS/backport-125066-to-release-21.05
[Backport release-21.05] radare2: add patch for CVE-2021-32613
2021-05-31 16:03:49 +02:00
Maximilian Bosch
aa9f441226 radare2: add patch for CVE-2021-32613
Closes #124670
See also https://nvd.nist.gov/vuln/detail/CVE-2021-32613

(cherry picked from commit 16ce969340)
2021-05-31 13:00:34 +00:00
Robert Scott
ef423b1205 Merge pull request #125060 from NixOS/backport-124791-to-release-21.05
[Backport release-21.05] v2ray: 4.38.3 -> 4.39.2
2021-05-31 13:54:15 +01:00
Robert Scott
c87afd2553 Merge pull request #125061 from NixOS/backport-124771-to-release-21.05
[Backport release-21.05] libxlsxwriter: 1.0.5 -> 1.0.6
2021-05-31 13:43:22 +01:00
Robert Scott
a8b758696c Merge pull request #125064 from NixOS/backport-125007-to-release-21.05
[Backport release-21.05] postgresqlPackages.pg_partman: 4.4.1 -> 4.5.1
2021-05-31 12:36:58 +01:00
Robert Scott
9ad5d4d363 postgresqlPackages.pg_partman: 4.4.1 -> 4.5.1
addressing CVE-2021-33204

(cherry picked from commit 29b5264841)
2021-05-31 10:48:29 +00:00
Michael Weiss
cbd00766e4 Merge pull request #125054 from NixOS/backport-124957-to-release-21.05
[Backport release-21.05] ungoogled-chromium: 90.0.4430.212 -> 91.0.4472.77
2021-05-31 12:27:56 +02:00
Robert Schütz
6cac8dd5d9 libxlsxwriter: 1.0.5 -> 1.0.6
https://github.com/jmcnamara/libxlsxwriter/releases/tag/RELEASE_1.0.6
(cherry picked from commit 5d873fde23)
2021-05-31 10:15:28 +00:00
Serval
41734b6851 v2ray: 4.38.3 -> 4.39.2
(cherry picked from commit c6f2290810)
2021-05-31 10:15:02 +00:00
蛇崩乃音
8479c43fa2 tailscale: 1.8.3 -> 1.8.5
(cherry picked from commit 57f67a8ec0)
2021-05-31 10:09:03 +00:00
Sandro
556951a923 Merge pull request #124796 from risicle/ris-hdbscan-disable-another-flaky-test-r21.05
[21.05] python3Packages.hdbscan: disable another flaky test
2021-05-31 12:08:48 +02:00
Thomas Gerbet
b9fd21fe40 morph: 1.5.0 -> 1.6.0
https://github.com/DBCDK/morph/releases/tag/v1.6.0
(cherry picked from commit 03465e588b)
2021-05-31 10:07:32 +00:00
matthewcroughan
7ca8def3b9 fioctl: 0.16 -> 0.17
(cherry picked from commit 005f0008a7)
2021-05-31 10:01:13 +00:00
Michael Weiss
2127c48d06 ungoogled-chromium: 90.0.4430.212 -> 91.0.4472.77
(cherry picked from commit 6c638ee6b1)
2021-05-31 09:51:05 +00:00
Maximilian Bosch
d25ea6a0d2 Merge pull request #125048 from NixOS/backport-124960-to-release-21.05
[Backport release-21.05] neomutt: add patch for CVE-2021-32055
2021-05-31 10:23:40 +02:00
Robert Scott
ad8e636a3e neomutt: add patch for CVE-2021-32055
no upstream release yet

(cherry picked from commit edcde75b98)
2021-05-31 08:07:35 +00:00
David Birks
a30a33bbff tilt: 0.18.10 -> 0.20.5
(cherry picked from commit 2aa7662279)
2021-05-31 07:20:30 +00:00
Sandro
3b7c820173 Merge pull request #124927 from NixOS/backport-124211-to-release-21.05
[Backport release-21.05] betterdiscordctl: 1.7.1 -> 2.0.0
2021-05-31 09:13:58 +02:00
SCOTT-HAMILTON
91efaf3393 libiio: fix build with wrong libxml2 find_package
Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
(cherry picked from commit 660c4a822c)
2021-05-31 02:40:27 -04:00
Jörg Thalheim
3018bf4b9e Merge pull request #125015 from NixOS/backport-94881-to-release-21.05
[Backport release-21.05] mblaze: fix mcom to use file utility.
2021-05-31 08:24:56 +02:00
guillaumecherel
aa2efdf901 Update pkgs/applications/networking/mailreaders/mblaze/default.nix
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
(cherry picked from commit 1e777e5ef02c89594bb1d2b772417df0ee176dcf)
2021-05-31 01:01:49 +00:00
guillaumecherel
ebdf00f038 Update pkgs/applications/networking/mailreaders/mblaze/default.nix
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
(cherry picked from commit e9d4b68fdc43af8e85868ae589eda51ce088c3e8)
2021-05-31 01:01:49 +00:00
Guillaume Chérel
7f016e24c7 Wrap mcom to add dependencies to PATH.
(cherry picked from commit 6dde14306092e81b58fc9b2b9082d138ab311cd8)
2021-05-31 01:01:48 +00:00
Sandro
a2e86da944 Merge pull request #124984 from NixOS/backport-124980-to-release-21.05
[Backport release-21.05] sageWithDoc: fix documentation symlinks
2021-05-31 03:00:57 +02:00
Sandro
0a28f8dc51 Merge pull request #125009 from NixOS/backport-124851-to-release-21.05 2021-05-31 02:59:00 +02:00
Dmitry Kalinkin
b0e7f01080 arrow-cpp: 4.0.0 -> 4.0.1
(cherry picked from commit cff04883e8)
2021-05-31 00:02:29 +00:00
github-actions[bot]
fc924fc34e xfitter: remove hardeningDisable = [ "format" ]; (#125001)
Not needed after f42aa7e1 ('cc-wrapper: set FC when langFortran is on')

(cherry picked from commit b72b3c5571)

Co-authored-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
2021-05-30 19:13:01 -04:00
Robert Scott
478f5d49f6 Merge pull request #124994 from NixOS/backport-124455-to-release-21.05
[Backport release-21.05] schismtracker: fix darwin build
2021-05-30 23:58:36 +01:00
Sandro
c91f853b0d Merge pull request #124998 from NixOS/backport-124111-to-release-21.05
[Backport release-21.05] python3Packages.drf-jwt: 1.19.0 -> 1.19.1
2021-05-31 00:56:59 +02:00
Robert Schütz
76fcaa085f python3Packages.drf-jwt: 1.19.0 -> 1.19.1
https://github.com/Styria-Digital/django-rest-framework-jwt/blob/1.19.1/CHANGELOG.md
(cherry picked from commit ffa6f1573c)
2021-05-30 22:30:33 +00:00
Stéphan Kochen
a2f6fc7092 schismtracker: fix darwin build
(cherry picked from commit e649cfc1e9)
2021-05-30 21:39:59 +00:00
Robert Scott
07ca3a021f Merge pull request #124953 from NixOS/backport-124732-to-release-21.05
[Backport release-21.05] icinga2: 2.12.3 -> 2.12.4
2021-05-30 22:27:51 +01:00
Robert Scott
ec2d3871f7 Merge pull request #124970 from NixOS/backport-124457-to-release-21.05
[Backport release-21.05] ocamlPackages.tyxml: 4.4.0 → 4.5.0
2021-05-30 22:24:56 +01:00
markuskowa
a027e1fa05 Merge pull request #124985 from NixOS/backport-124952-to-release-21.05
[Backport release-21.05] halide: Fix build
2021-05-30 20:59:09 +02:00
Christian Kögler
cd8efe13e0 halide: Fix build
(cherry picked from commit ba677b14dd)
2021-05-30 18:13:07 +00:00
Mauricio Collares
1834af74e3 sageWithDoc: fix documentation symlinks
(cherry picked from commit 2c7d2ce295)
2021-05-30 18:02:11 +00:00
Robert Scott
0e2b7ebdde Merge pull request #124822 from NixOS/backport-124792-to-release-21.05
[Backport release-21.05] b3sum: 0.3.7 -> 0.3.8
2021-05-30 17:32:04 +01:00
Robert Scott
a74605831e Merge pull request #124830 from NixOS/backport-124065-to-release-21.05
[Backport release-21.05] bjumblr: 1.4.2 -> 1.6.6
2021-05-30 16:24:28 +01:00
Robert Scott
439b6d5c2c Merge pull request #124825 from NixOS/backport-124784-to-release-21.05
[Backport release-21.05] corerad: 0.3.0 -> 0.3.1
2021-05-30 16:22:25 +01:00
Martin Weinelt
4cd3fd238d Merge pull request #124968 from NixOS/backport-124947-to-release-21.05 2021-05-30 17:21:40 +02:00
Robert Scott
95d4bdbaae Merge pull request #124832 from NixOS/backport-124109-to-release-21.05
[Backport release-21.05] tellico: 3.4 -> 3.4.1
2021-05-30 16:21:01 +01:00
Ulrik Strid
e3a1e350ba ocamlPackages.tyxml: 4.4.0 → 4.5.0
(cherry picked from commit 3fcd7a46dc4576f65c7bcd13ee12a71a456df904)
2021-05-30 15:05:47 +00:00
Janne Heß
4f9eadefdc Update nixos/modules/virtualisation/libvirtd.nix
Co-authored-by: Martin Weinelt <mweinelt@users.noreply.github.com>
(cherry picked from commit 964fc7cfef)
2021-05-30 14:56:41 +00:00
Janne Heß
c072a18797 nixos/libvirtd: Take ethertypes from iptables-nftables-compat
iptables is currently defined in `all-packages.nix` to be
iptables-compat. That package does however not contain `ethertypes`.
Only `iptables-nftables-compat` contains this file so the symlink
dangles.

(cherry picked from commit 2eeecef3fc)
2021-05-30 14:56:41 +00:00
Robert Scott
0c39e877ec Merge pull request #124908 from NixOS/backport-124859-to-release-21.05
[Backport release-21.05] python3Packages.smhi-pkg: 1.0.14 -> 1.0.15
2021-05-30 14:42:15 +01:00
Robert Scott
ab9f3f2f9e Merge pull request #124922 from NixOS/backport-124911-to-release-21.05
[Backport release-21.05] catgirl: 1.7 -> 1.8
2021-05-30 13:54:29 +01:00
Robert Scott
9fd05bb58f Merge pull request #124937 from NixOS/backport-124066-to-release-21.05
[Backport release-21.05] Gxplugins-Lv2: 0.8 -> 0.9
2021-05-30 13:51:08 +01:00
Robert Scott
d9df705215 Merge pull request #124933 from NixOS/backport-124575-to-release-21.05
[Backport release-21.05] goattracker,goattracker-stereo: 2.75 -> 2.76, 2.76 -> 2.77
2021-05-30 13:39:13 +01:00
Robert Scott
6ca456a1c9 Merge pull request #124934 from NixOS/backport-124325-to-release-21.05
[Backport release-21.05] babashka: 0.4.1 -> 0.4.3
2021-05-30 13:30:34 +01:00
R. RyanTM
2afcd85748 icinga2: 2.12.3 -> 2.12.4
(cherry picked from commit 5be9a1d161)
2021-05-30 12:30:25 +00:00
Robert Scott
a33878b687 Merge pull request #124930 from NixOS/backport-124222-to-release-21.05
[Backport release-21.05] kooha: 1.1.3 -> 1.2.1
2021-05-30 12:52:07 +01:00
Robert Scott
07796133d4 Merge pull request #124931 from NixOS/backport-124904-to-release-21.05
[Backport release-21.05] gitRepo: 2.14.5 -> 2.15.3
2021-05-30 12:49:41 +01:00
Robert Scott
bae3f3be2a Merge pull request #124928 from NixOS/backport-124713-to-release-21.05
[Backport release-21.05] getdata: add security patch from Debian
2021-05-30 12:46:21 +01:00
Robert Scott
60c22bd341 Merge pull request #124929 from NixOS/backport-124918-to-release-21.05
[Backport release-21.05] newsflash: fix build
2021-05-30 12:44:32 +01:00
Robert Scott
2063939edd Merge pull request #124940 from NixOS/backport-124351-to-release-21.05
[Backport release-21.05] sacad: 2.3.4 -> 2.4.0
2021-05-30 12:33:13 +01:00
Michele Guerini Rocco
c399b0f178 Merge pull request #124946 from NixOS/backport-123253-to-release-21.05
[Backport release-21.05] vapoursynth: improve plugin dependency resolution
2021-05-30 11:31:35 +02:00
Kim Lindberger
4c4a45e284 Merge pull request #124945 from NixOS/backport-124472-to-release-21.05
[Backport release-21.05] keycloak: 13.0.0 -> 13.0.1
2021-05-30 10:47:01 +02:00
Robert Schütz
f63370194e Merge pull request #124926 from NixOS/backport-124874-to-release-21.05
[Backport release-21.05] pika-backup: 0.3.1 -> 0.3.2
2021-05-30 10:40:04 +02:00
markuskowa
3d7ced7b59 Merge pull request #124923 from NixOS/backport-124893-to-release-21.05
[Backport release-21.05] welle-io: 2.2 -> 2.3
2021-05-30 10:37:47 +02:00
Simon Bruder
bad208a3e6 vapoursynth: improve plugin dependency resolution
Some python packages (e.g. functools32) are conditionally disabled for
certain interpreter versions by having them return null instead of a
derivation. `getRecursivePropagatedBuildInputs` fails if such a package
is part of the dependency tree. This commit makes it only recurse into
derivations and ignore everything else.

This also deduplicates the final plugin list to improve startup time.

(cherry picked from commit 9b3a2e66b1)
2021-05-30 08:26:24 +00:00
R. RyanTM
b3197b1334 keycloak: 13.0.0 -> 13.0.1
(cherry picked from commit 153eed5204)
2021-05-30 07:41:53 +00:00
Robert Schütz
e3ddcfdf2c capture: use ffmpeg instead of ffmpeg_3
(cherry picked from commit 36f7a012b7)
2021-05-29 23:58:51 -04:00
Sandro
2a0ab9f511 Merge pull request #124924 from NixOS/backport-124898-to-release-21.05
[Backport release-21.05] gotty: 2.0.0-alpha.3 -> 1.2.0
2021-05-30 05:29:23 +02:00
fortuneteller2k
0659aeb14f sacad: 2.3.4 -> 2.4.0
(cherry picked from commit 753452f808)
2021-05-30 03:20:42 +00:00
Sandro
04d804d0ab Merge pull request #124932 from NixOS/backport-124920-to-release-21.05
[Backport release-21.05] twine: add top-level entry
2021-05-30 05:07:27 +02:00
Bart Brouns
9b98f80829 Gxplugins-Lv2: 0.8 -> 0.9
(cherry picked from commit a9c375563e)
2021-05-30 02:32:21 +00:00
Thiago Kenji Okada
e04a17a37e babashka: add thiagokokada as maintainer
(cherry picked from commit 9eee935ec232fffeda4917dba800967cf222eb0c)
2021-05-30 02:30:26 +00:00
Thiago Kenji Okada
20387998ce babashka: 0.4.1 -> 0.4.3
(cherry picked from commit 113fc7d71c1797983b4f3c40cf470befacb7fc04)
2021-05-30 02:30:26 +00:00
Francesco Gazzetta
0557b7bfb1 goattracker,goattracker-stereo: 2.75 -> 2.76, 2.76 -> 2.77
(cherry picked from commit 70dc16dec8)
2021-05-30 02:29:54 +00:00
Sandro
52223c3d1d Merge pull request #124827 from NixOS/backport-124685-to-release-21.05
[Backport release-21.05] terraria-server: 1.4.2.2 -> 1.4.2.3
2021-05-30 04:23:30 +02:00
Sandro Jäckel
c99249df0f twine: add top-level entry
(cherry picked from commit 166e67b4de)
2021-05-30 02:20:11 +00:00
Otavio Salvador
1f6295e555 gitRepo: Add updateScript support for easier upgrade in future
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
(cherry picked from commit ee498167d0f1d4825baa0d7d6f98bb7424db19e8)
2021-05-30 02:20:06 +00:00
Otavio Salvador
042c54b758 gitRepo: add missing preInstall and postInstall hooks calls
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
(cherry picked from commit 9d161bd45c40168a8aa83667fa4bf1b600ccc262)
2021-05-30 02:20:06 +00:00
Otavio Salvador
a5a6efd9b4 gitRepo: Drop unnecessary patch
The import-ssl-module.patch does not seem to be need and the tool seem
to be working just fine. Drop the patch.

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
(cherry picked from commit 94d5fd438d6df069d6d303fb046e430f6118a93a)
2021-05-30 02:20:06 +00:00
Otavio Salvador
6eac23ff6a gitRepo: add myself as maintainer
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
(cherry picked from commit 3a37d115ef369c03810a2339a09449d5c18a103d)
2021-05-30 02:20:05 +00:00
Otavio Salvador
a51efd1bb4 gitRepo: 2.14.5 -> 2.15.3
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
(cherry picked from commit 19807e4ced2eea5c8f52a6e86df24e10ebb15367)
2021-05-30 02:20:05 +00:00
Austin Butler
8a6d0863c5 kooha: 1.1.3 -> 1.2.1
(cherry picked from commit 3d8311849e)
2021-05-30 02:19:51 +00:00
figsoda
4a4105f069 newsflash: fix build
(cherry picked from commit b0b823be50)
2021-05-30 02:14:00 +00:00
Sandro
4330bdd244 Update pkgs/development/libraries/getdata/default.nix
(cherry picked from commit 1b77912d10ba5a5e8ddf7853f00ac3cb841d59bf)
2021-05-30 02:08:03 +00:00
Vincent Laporte
81c84a9194 getdata: add security patch from Debian
(cherry picked from commit 14bb4b8f9aed4b1e04c0edab0851c31144ccd7e3)
2021-05-30 02:08:03 +00:00
Dusk Banks
9cab6e0dd4 betterdiscordctl: 1.7.1 -> 2.0.0
(cherry picked from commit 35a1e99d7a)
2021-05-30 02:04:55 +00:00
Robert Schütz
d27b376262 pika-backup: 0.3.1 -> 0.3.2
https://gitlab.gnome.org/World/pika-backup/-/tags/v0.3.2
(cherry picked from commit 52c24e9fbe)
2021-05-30 02:04:12 +00:00
Pavol Rusnak
725af5376f gotty: 2.0.0-alpha.3 -> 1.2.0
new upstream, versioning scheme changed back to v 1.x

(cherry picked from commit 5a8cd34dba)
2021-05-30 01:53:51 +00:00
Markus Kowalewski
a217eed6b8 welle-io: 2.2 -> 2.3
(cherry picked from commit af44c17b5d)
2021-05-30 01:52:44 +00:00
xfnw
e57ea488f9 catgirl: 1.7 -> 1.8
(cherry picked from commit 645446afa5)
2021-05-30 01:49:20 +00:00
Fabian Affolter
efbb010dfb python3Packages.smhi-pkg: 1.0.14 -> 1.0.15
(cherry picked from commit ebbc5a8728ac7002e9f86a0dfdbb660d50f6d689)
2021-05-29 23:13:17 +00:00
Fabian Affolter
fb75a2a13f python3Packages.pyrituals: 0.0.2 -> 0.0.3
(cherry picked from commit e678ecdc0d0dd9149330cf525939a451c4248b7d)
2021-05-29 16:08:57 -07:00
Robert Schütz
6460c5ce33 openvpn-auth-ldap: 2.0.3+deb6.1 -> 2.0.4
(cherry picked from commit f734a05c8c01f54e14432c2adb92d9291c69bb18)
2021-05-29 15:57:16 -07:00
Martin Weinelt
c1757ad15a Merge pull request #124895 from NixOS/backport-124839-to-release-21.05
[Backport release-21.05] nixos/wordpress: regenerate secret keys if misspelled key name is found
2021-05-30 00:46:56 +02:00
Dmitry Kalinkin
7198e20169 webkitgtk: fix on darwin
(cherry picked from commit 61e49ba58b)
2021-05-29 18:39:16 -04:00
markuskowa
fb64e7de78 Merge pull request #124896 from NixOS/backport-124890-to-release-21.05
[Backport release-21.05] mpich: 3.4.1 -> 3.4.2
2021-05-29 22:57:05 +02:00
github-actions[bot]
8dc1b48597 cargo-raze: fix darwin (#124343)
* cargo-raze: fix darwin

Disable tests on darwin as they've started failing after the latest update: #119531

Example failure: https://hydra.nixos.org/build/143411545

* Update pkgs/development/tools/rust/cargo-raze/default.nix

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>

(cherry picked from commit 48b6b8b8c6)
2021-05-29 16:50:27 -04:00
Markus Kowalewski
58ba40336c mpich: 3.4.1 -> 3.4.2
(cherry picked from commit 0853275727)
2021-05-29 20:17:55 +00:00
Martin Weinelt
f4d6d51a09 nixos/wordpress: regenerate secret keys if misspelled key name is found
A secret key generated by the nixos module was misspelled, which could
possibly impact the security of session cookies.

To recover from this situation we will wipe all security keys that were
previously generated by the NixOS module, when the misspelled one is
found. This will result in all session cookies being invalidated. This
is confirmed by the wordpress documentation:

> You can change these at any point in time to invalidate all existing
> cookies. This does mean that all users will have to login again.

https://wordpress.org/support/article/editing-wp-config-php/#security-keys

Meanwhile this issue shouldn't be too grave, since the salting function
of wordpress will rely on the concatenation of both the user-provided
and automatically generated values, that are stored in the database.

> Secret keys are located in two places: in the database and in the
> wp-config.php file. The secret key in the database is randomly
> generated and will be appended to the secret keys in wp-config.php.

https://developer.wordpress.org/reference/functions/wp_salt/

Fixes: 2adb03fdae ("nixos/wordpress:
generate secrets locally")

Reported-by: Moritz Hedtke <Moritz.Hedtke@t-online.de>
(cherry picked from commit 724ed08df0)
2021-05-29 20:16:47 +00:00
Maximilian Bosch
e7f90ce89c Merge pull request #124821 from NixOS/backport-124408-to-release-21.05
[Backport release-21.05] virt-manager: fix missing cdrtools
2021-05-29 20:37:14 +02:00
Pavol Rusnak
1166a744e3 Merge pull request #124130 from prusnak/cocotb-21.05
[21.05] python3Packages.cocotb: 1.5.1 -> 1.5.2
2021-05-29 19:52:22 +02:00
Guillaume Girol
c30d29421b Merge pull request #124879 from NixOS/backport-124798-to-release-21.05
[Backport release-21.05] paperwork: 2.0.2 -> 2.0.3 and compile user manual
2021-05-29 16:33:30 +00:00
Symphorien Gibol
78268a73a1 paperwork: 2.0.2 -> 2.0.3 and compile user manual
(cherry picked from commit dc3054b4ae)
2021-05-29 15:01:48 +00:00
Robert Schütz
c258bb29a3 Merge pull request #124759 from dotlambda/whipper-fix
[21.05] whipper: fix
2021-05-29 15:33:20 +02:00
Robert Schütz
6eba052712 Merge pull request #124275 from lunik1/libretro-ppsspp-ffmpeg4-backport
[21.05] libretro.ppsspp: backport update and fix build against ffmpeg 4.4
2021-05-29 12:48:36 +02:00
Robert Schütz
417b79b504 samba: 4.13.7 -> 4.14.4
fixes https://www.samba.org/samba/security/CVE-2021-20254.html

(cherry picked from commit 2db53555ee297acb1dbce22e4342ac6f37e14407)
2021-05-28 23:06:49 -07:00
Robert Schütz
a68c14446b python3Packages.cssutils: 2.2.0 -> 2.3.0
https://github.com/jaraco/cssutils/blob/v2.3.0/CHANGES.rst
(cherry picked from commit ade1f796cb)
2021-05-28 22:20:46 -07:00
Robert Schütz
0bfc2cc9ea spotdl: 3.5.2 -> 3.6.1
https://github.com/spotDL/spotify-downloader/releases/tag/v3.6.0
https://github.com/spotDL/spotify-downloader/releases/tag/v3.6.1
(cherry picked from commit 7683afc895)
2021-05-28 22:17:51 -07:00
talyz
b423efaeeb nixos/discourse: Assert deployed PostgreSQL version
Assert that the PostgreSQL version being deployed is the one used
upstream. Allow the user to override this assertion, since it's not
always possible or preferable to use the recommended one.

(cherry picked from commit 544adbfcab2e92c2fe5774cae67f2edf165eb97e)
2021-05-28 22:16:10 -07:00
Ryan Mulligan
4594e54063 nixos/discourse: Add rsync dependency
It is used for backup importing.

(cherry picked from commit e9c5ee1c4e48dc996773ccdbc0347f18fad31db9)
2021-05-28 22:16:10 -07:00
talyz
ce5587e7bb discourse: 2.6.5 -> 2.7.0
(cherry picked from commit 42b8e7685d5fe5280f8f6101a6d19016b92f3a5c)
2021-05-28 22:16:10 -07:00
Daniël de Kok
c892433d7b softmaker-office: 1030 -> 1032
(cherry picked from commit 854c4ad2d9)
2021-05-28 22:13:27 -04:00
Sandro
6ca6be2bbf Merge pull request #124835 from NixOS/backport-124819-to-release-21.05
[Backport release-21.05] gitAndTools.delta: 0.7.1 -> 0.8.0
2021-05-29 03:49:17 +02:00
Zhaofeng Li
25115a31d7 xpra: Add NVENC support
(cherry picked from commit 80e86f8871)
2021-05-28 21:39:53 -04:00
Zhaofeng Li
a5cbb1a436 nv-codec-headers-10: init at 10.0.26.2
(cherry picked from commit 13f114593b)
2021-05-28 21:39:53 -04:00
Dominik Xaver Hörl
fa5915bebb rl-2105: mention linux_latest and potential zfs issues
(cherry picked from commit 7953b6e532be68c76e0e02bf6c83ff9350ad529e)
2021-05-28 18:32:16 -07:00
Dominik Xaver Hörl
c50592961a linuxPackages_latest: update to 5.12
(cherry picked from commit 755db9a1e9a35c185f7d6c0463025e94ef44622e)
2021-05-28 18:32:16 -07:00
Mario Rodas
53ad00cfc3 gitAndTools.delta: 0.7.1 -> 0.8.0
https://github.com/dandavison/delta/releases/tag/0.8.0
(cherry picked from commit 4052d0eceb)
2021-05-29 01:31:34 +00:00
Niklas Hambüchen
b73e47d3d7 nixos/wireguard: Remove .path systemd unit for privkey. Fixes #123203
As per `man systemd.path`:

> When a service unit triggered by a path unit terminates
> (regardless whether it exited successfully or failed),
> monitored paths are checked immediately again,
> **and the service accordingly restarted instantly**.

Thus the existence of the path unit made it impossible to stop the
wireguard service using e.g.

    systemctl stop wireguard-wg0.service

Systemd path units are not intended for program inputs such
as private key files.
This commit simply removes this usage; the private key is still
generated by the `generateKeyServiceUnit`.

(cherry picked from commit d344dccf3d)
2021-05-28 18:28:35 -07:00
Peter Hoeg
36f8feac81 tellico: 3.4 -> 3.4.1
(cherry picked from commit 1bfabf6fba)
2021-05-29 01:14:45 +00:00
Bart Brouns
8d914c1157 bjumblr: 1.4.2 -> 1.6.6
(cherry picked from commit de9f169ecc)
2021-05-29 01:07:01 +00:00
greaka
7b1072b4ff terraria-server: 1.4.2.2 -> 1.4.2.3
(cherry picked from commit 4e9bd87f5a)
2021-05-29 01:02:37 +00:00
Matt Layher
d981999780 corerad: 0.3.0 -> 0.3.1
Signed-off-by: Matt Layher <mdlayher@gmail.com>
(cherry picked from commit 39b4c8f9af)
2021-05-29 00:56:22 +00:00
Vladyslav M
ad947d5fa6 b3sum: 0.3.7 -> 0.3.8
(cherry picked from commit 42d671a80d)
2021-05-29 00:51:22 +00:00
Sandro
b08b7cd9b7 Apply suggestions from code review
(cherry picked from commit 902ce1df42adc35ca871c5b7c00d0b6dad145749)
2021-05-29 00:50:47 +00:00
superherointj
84fd858633 virt-manager: fix missing cdrtools
(cherry picked from commit 13f3200cd056e44886f063e8d785460b172523df)
2021-05-29 00:50:47 +00:00
Sandro
d5d7312426 Merge pull request #124805 from prusnak/electron-21.05 2021-05-29 02:09:24 +02:00
Domen Kožar
8a5ec66c40 patray: Yet another tray pulseaudio frontend
(cherry picked from commit 4758dd4814)
2021-05-28 18:36:24 -04:00
Domen Kožar
5b3858527f pythonPackages.google-api-python-client: 2.0.2 -> 2.6.0
(cherry picked from commit 184b453090)
2021-05-28 18:36:24 -04:00
fortuneteller2k
b1a828fa56 fetchutils: remove DESTDIR, use PREFIX, change owner
(cherry picked from commit feef79647f1da6fe2e06e9cfc72dd923641a3c7e)
2021-05-28 18:35:43 -04:00
Martin Weinelt
75d84510e1 Merge pull request #124787 from mohe2015/backport-124516
[21.05] wordpress: 5.7.1 -> 5.7.2
2021-05-29 00:35:00 +02:00
Stefan Frijters
18cd14175f doc/coding-conventions: Add documentation for fetchpatch optional arguments
(cherry picked from commit 585f63b364)
2021-05-28 18:34:45 -04:00
Mitsuhiro Nakamura
5b52f151e1 feedgnuplot: 1.51 -> 1.58
(cherry picked from commit b9bf2ab441)
2021-05-28 18:33:53 -04:00
Mitsuhiro Nakamura
831bf15565 feedgnuplot: fix perl shebang
(cherry picked from commit 75176e353c)
2021-05-28 18:33:53 -04:00
Michael Raskin
47ed684380 Merge pull request #124801 from dotlambda/CVE-2020-18032
[21.05] graphviz: patch CVE-2020-18032
2021-05-28 21:15:34 +00:00
Maximilian Bosch
d77e68bedf Merge pull request #124793 from NixOS/backport-124121-to-release-21.05
[Backport release-21.05] libreoffice-still: 7.0.4.2 -> 7.0.6.2
2021-05-28 23:06:09 +02:00
TredwellGit
04fcd9e107 electron_10: 10.4.5 -> 10.4.7
https://github.com/electron/electron/releases/tag/v10.4.6
https://github.com/electron/electron/releases/tag/v10.4.7
(cherry picked from commit f8fbfa538b)
2021-05-28 23:03:44 +02:00
TredwellGit
836e34d53a electron_11: 11.4.6 -> 11.4.7
https://github.com/electron/electron/releases/tag/v11.4.7
(cherry picked from commit 505298f812)
2021-05-28 23:03:39 +02:00
TredwellGit
361dbda2ca electron_12: 12.0.7 -> 12.0.9
https://github.com/electron/electron/releases/tag/v12.0.8
https://github.com/electron/electron/releases/tag/v12.0.9
(cherry picked from commit a0426609c8)
2021-05-28 23:03:33 +02:00
Robert Schütz
2899292e07 graphviz: patch CVE-2020-18032
(cherry picked from commit b4e8099795)
2021-05-28 22:17:21 +02:00
Maximilian Bosch
9588f49304 Merge pull request #124794 from NixOS/backport-124703-to-release-21.05
[Backport release-21.05] Revert "element-desktop: set dbus default for firefox"
2021-05-28 22:13:43 +02:00
Maximilian Bosch
eff32c3626 Merge pull request #124797 from NixOS/backport-124790-to-release-21.05
[Backport release-21.05] diffoscope: 175 -> 176
2021-05-28 22:08:25 +02:00
Arthur Gautier
4e172daaa6 diffoscope: 175 -> 176
Signed-off-by: Arthur Gautier <baloo@superbaloo.net>
(cherry picked from commit fd2e675e7c)
2021-05-28 19:38:56 +00:00
Robert Scott
5621b77a7e python3Packages.hdbscan: disable another flaky test
(cherry picked from commit 5bae3c6746)
2021-05-28 20:30:32 +01:00
Evils
6350467e7b Revert "element-desktop: set dbus default for firefox"
This reverts commit becc715b89.

(cherry picked from commit 6377bc3662)
2021-05-28 19:28:58 +00:00
Thomas Gerbet
7e7e91f8e2 libreoffice-still: 7.0.4.2 -> 7.0.6.2
This will avoid false positives with CVE-2021-25631 [0] (only impact
Windows).
It also includes bugfixes:
https://wiki.documentfoundation.org/Releases/7.0.5/RC1
https://wiki.documentfoundation.org/Releases/7.0.5/RC2
https://wiki.documentfoundation.org/Releases/7.0.6/RC1
https://wiki.documentfoundation.org/Releases/7.0.6/RC2

[0] https://www.libreoffice.org/about-us/security/advisories/cve-2021-25631/

(cherry picked from commit f7b33e0334)
2021-05-28 19:25:16 +00:00
Ivan Kozik
02daee80bc nixos/bitwarden_rs: fix startup on 32 thread machines
LimitNPROC=64 is too low for bitwarden_rs to start on a 32 thread machine.
Remove the limit.

This fixes:

```
bitwarden_rs[38701]: /--------------------------------------------------------------------\
bitwarden_rs[38701]: |                       Starting Bitwarden_RS                        |
bitwarden_rs[38701]: |--------------------------------------------------------------------|
bitwarden_rs[38701]: | This is an *unofficial* Bitwarden implementation, DO NOT use the   |
bitwarden_rs[38701]: | official channels to report bugs/features, regardless of client.   |
bitwarden_rs[38701]: | Send usage/configuration questions or feature requests to:         |
bitwarden_rs[38701]: |   https://bitwardenrs.discourse.group/                             |
bitwarden_rs[38701]: | Report suspected bugs/issues in the software itself at:            |
bitwarden_rs[38701]: |   https://github.com/dani-garcia/bitwarden_rs/issues/new           |
bitwarden_rs[38701]: \--------------------------------------------------------------------/
bitwarden_rs[38701]: [INFO] No .env file found.
bitwarden_rs[38701]: [2021-05-24 03:34:41.121][bitwarden_rs::api::core::sends][INFO] Initiating send deletion
bitwarden_rs[38701]: [2021-05-24 03:34:41.122][start][INFO] Rocket has launched from http://127.0.0.1:8222
bitwarden_rs[38701]: [2021-05-24 03:34:41.126][panic][ERROR] thread 'unnamed' panicked at 'failed to spawn thread: Os { code: 11, kind: WouldBlock, message: "Resource temporarily unavailable" }': /build/rustc-1.52.1-src/library/std/src/thread/mod.rs:620
bitwarden_rs[38701]:    0: bitwarden_rs::init_logging::{{closure}}
bitwarden_rs[38701]:    1: std::panicking::rust_panic_with_hook
bitwarden_rs[38701]:    2: std::panicking::begin_panic_handler::{{closure}}
bitwarden_rs[38701]:    3: std::sys_common::backtrace::__rust_end_short_backtrace
bitwarden_rs[38701]:    4: rust_begin_unwind
bitwarden_rs[38701]:    5: core::panicking::panic_fmt
bitwarden_rs[38701]:    6: core::result::unwrap_failed
bitwarden_rs[38701]:    7: hyper::server::listener::spawn_with
bitwarden_rs[38701]:    8: hyper::server::listener::ListenerPool<A>::accept
bitwarden_rs[38701]:    9: std::sys_common::backtrace::__rust_begin_short_backtrace
bitwarden_rs[38701]:   10: core::ops::function::FnOnce::call_once{{vtable.shim}}
bitwarden_rs[38701]:   11: std::sys::unix::thread::Thread::new::thread_start
bitwarden_rs[38701]:   12: start_thread
bitwarden_rs[38701]:   13: __GI___clone
bitwarden_rs[38701]: [2021-05-24 03:34:41.126][panic][ERROR] thread 'main' panicked at 'internal error: entered unreachable code: the call to `handle_threads` should block on success': /build/bitwarden_rs-1.20.0-vendor.tar.gz/rocket/src/rocket.rs:751
bitwarden_rs[38701]:    0: bitwarden_rs::init_logging::{{closure}}
bitwarden_rs[38701]:    1: std::panicking::rust_panic_with_hook
bitwarden_rs[38701]:    2: std::panicking::begin_panic_handler::{{closure}}
bitwarden_rs[38701]:    3: std::sys_common::backtrace::__rust_end_short_backtrace
bitwarden_rs[38701]:    4: rust_begin_unwind
bitwarden_rs[38701]:    5: core::panicking::panic_fmt
bitwarden_rs[38701]:    6: rocket::rocket::Rocket::launch
bitwarden_rs[38701]:    7: bitwarden_rs::main
bitwarden_rs[38701]:    8: std::sys_common::backtrace::__rust_begin_short_backtrace
bitwarden_rs[38701]:    9: std::rt::lang_start::{{closure}}
bitwarden_rs[38701]:   10: std::rt::lang_start_internal
bitwarden_rs[38701]:   11: main
```

(cherry picked from commit d95960e275)
2021-05-28 11:36:54 -07:00
Hedtke, Moritz
fcddce0f10 wordpress: 5.7.1 -> 5.7.2
(cherry picked from commit 5fa469b6f2)
2021-05-28 20:34:51 +02:00
Fabián Heredia Montiel
79c5dbb549 pgsync: 0.6.6 → 0.6.7
(cherry picked from commit cc855b1331)
2021-05-28 11:34:51 -07:00
Antoine R. Dumont (@ardumont)
80df101aa8 mediatomb/gerbera: Add release note information for 21.03
Note that it made into 2 entries, one about new options in the first section.
Another in the breaking compatibility section due to the openFirewall option
which changes the behavior.

Co-authored-by: schmittlauch <t.schmittlauch+nixos@orlives.de>
(cherry picked from commit 93a80a4390499b4204cf6836bcc6cab5debecccb)
2021-05-28 11:21:30 -07:00
Robert Schütz
377de4787e Merge pull request #124757 from dotlambda/mediatomb-ffmpeg
[21.05] mediatomb: use ffmpeg instead of ffmpeg_3
2021-05-28 17:25:41 +02:00
Robert Schütz
078af61232 whipper: fix
(cherry picked from commit df7eecceb5)
2021-05-28 16:29:33 +02:00
Robert Schütz
989c034206 mediatomb: use ffmpeg instead of ffmpeg_3 (#123487)
(cherry picked from commit 81abd8d0ac)
2021-05-28 16:10:23 +02:00
David
8d31a9d644 rebar3: 3.16.0 -> 3.16.1
(cherry picked from commit d706be982a)
2021-05-28 20:43:11 +09:00
Robert Schütz
1c212ecbb8 Merge pull request #124707 from dotlambda/openvpn-2.5.2
[21.05] openvpn: 2.5.0 -> 2.5.2, openvpn_24: 2.4.9 -> 2.4.11
2021-05-28 10:20:03 +02:00
Thomas Gerbet
88144f9b91 openvpn_24: 2.4.9 -> 2.4.11
Fixes CVE-2020-15078.
https://community.openvpn.net/openvpn/wiki/CVE-2020-15078

(cherry picked from commit e2df9554b0)
2021-05-28 01:02:33 +02:00
Thomas Gerbet
6929dd4f0b openvpn: 2.5.0 -> 2.5.2
Fixes CVE-2020-15078.
https://community.openvpn.net/openvpn/wiki/CVE-2020-15078

(cherry picked from commit 82f90f892f)
2021-05-28 01:02:33 +02:00
Robert Schütz
2371e028f6 Merge pull request #124701 from jchw-forks/lightspark-ffmpeg-backport
[21.05] lightspark: ffmpeg_3 -> ffmpeg
2021-05-28 00:19:16 +02:00
John Chadwick
47c51cc3bf lightspark: ffmpeg_3 -> ffmpeg
(cherry picked from commit 24129003fd)
2021-05-27 14:42:25 -07:00
Dmitry Kalinkin
46a5d32fc9 qhull: add fixDarwinDylibNames
(cherry picked from commit e34b559109)
cc #124578
2021-05-27 16:55:02 -04:00
Michael Weiss
6029acc019 Merge pull request #124598 from primeos/backports
[21.05] nixos/tests/{sway,cagebreak}: Disable on aarch64-linux
2021-05-27 18:56:31 +02:00
Michael Weiss
5e74829b72 nixos/tests/{sway,cagebreak}: Disable on aarch64-linux
The tests timeout on AArch64 (e.g. [0] and [1]), likely because the QEMU
option "-vga virtio" isn't supported there (unfortunately I currently
lack access to an AArch64 system with NixOS to investigate).

This also affects the test for Cage but that one is already limited to
x86_64-linux.

[0]: https://hydra.nixos.org/build/144148809
[1]: https://hydra.nixos.org/build/144103034

(cherry picked from commit abb9ea73f7)
2021-05-27 17:43:06 +02:00
Michael Lingelbach
676ddafd3d nixos/dendrite: remove (#124524)
* The options tlsKey and tlsCert require being accessible by DynamicUser at runtime, which currently requires copying the files into the matrix service state directory. Fixing this might require breaking changes. Thus the module should not be included in a stable release.
2021-05-27 10:41:05 +02:00
Trolli Schmittlauch
611cedc127 poppler: build with nss by default for signature support
Since 21.01, poppler supports PDF signing. As applications like okular
start to make use of that feature, nss support for poppler is enabled by
default to avoid unnecessary package duplication.
When building a `minimal` version of poppler, nss is disabled as well.

closes #120928

(cherry picked from commit 5f9862d524ee0ec1edcaa450fff4f54f4f5cc68e)
2021-05-27 03:48:21 -04:00
Sandro
ff00b8c0d1 Merge pull request #124565 from nbren12/jupyterlab-backport 2021-05-27 05:16:18 +02:00
Sandro
17293ccdfc Merge pull request #124448 from mweinelt/21.05/home-assistant
[21.05] home-assistant: disable flaky test in prometheus component
2021-05-27 05:14:07 +02:00
Noah D. Brenowitz
c8a75ccf74 python3Packages.nbclassic: allow darwin network tests
(cherry picked from commit f1096cd92c)
2021-05-26 19:33:40 -07:00
Noah D. Brenowitz
a0011e1118 python3Packages.jupyterlab_server: allow darwin networking
(cherry picked from commit 7c29b3e082)
2021-05-26 19:33:40 -07:00
Noah D. Brenowitz
a2547d21eb python3Packages.jupyter_server: allow local networking
(cherry picked from commit 1244ddc7c6)
2021-05-26 19:33:40 -07:00
Sandro
e7e53babb6 Merge pull request #124515 from primeos/signal-desktop-backport 2021-05-27 04:30:52 +02:00
Sandro
0a086ee342 Merge pull request #124509 from dotlambda/backport-124391 2021-05-27 04:30:18 +02:00
Sandro
837f80023d Merge pull request #124526 from risicle/ris-devpi-client-server-darwin-allow-local-networking-r21.05 2021-05-27 03:49:58 +02:00
Sandro
83fb69d685 Merge pull request #124527 from risicle/ris-python-xgboost-darwin-fix-r21.05 2021-05-27 03:47:21 +02:00
Sandro
51cf39407b Merge pull request #124555 from hrhino/backport/fix/python3Packages/acoustics
acoustics: fix
2021-05-27 02:57:27 +02:00
Robert Scott
deb0a4259f python3Packages.mat2: fix tests against ffmpeg 4.4
seems upstream have already noticed this breakage and have fixed it
in master

(cherry picked from commit 6d8b59ab30)
2021-05-26 19:44:58 -04:00
Harrison Houghton
5369265a53 acoustics: fix
There's a bit of LaTeX math code in a comment in a test file:

```
    .. math:: L = 10 \cdot \\log_{10}{\\left(\\frac{MS}{p_r^2} \\right)}
```

which of course should be `\\cdot`.

I could patch it, but I think skipping deprecation warnings in tests is
probably ok... (If nothing else it's easier.)

(cherry picked from commit dbc085cb44)
2021-05-26 19:32:26 -04:00
austinbutler
84a08eb98d stellar-core: 0.5.1 -> 17.0.0 (#123294)
(cherry picked from commit 2a6db4c056)
2021-05-26 19:30:48 -04:00
Maximilian Bosch
95f6c0b7e0 nixos/release-notes: fix slaptest command for openldap section
When running - as suggested - `slaptest -f slapd.conf $TMPDIR` I get the
following result:

    [root@ldap:/tmp/tmp.De46ABIbFf]# slaptest -f /nix/store/lks3ihydj40ff6yqvz0k33ycrc9vbyry-slapd.conf $TMPDIR
    usage: slaptest [-v] [-d debuglevel] [-f configfile] [-F configdir] [-o <name>[=<value>]] [-n databasenumber] [-u] [-Q]

    [root@ldap:/tmp/tmp.De46ABIbFf]# echo $?
    1

Adding a `-F` option fixes the issue.

(cherry picked from commit b5a12b4b61)
2021-05-26 22:35:51 +02:00
Maximilian Bosch
25eaf1083f diffoscope: fix build
ZHF #122042
Failing Hydra build: https://hydra.nixos.org/build/143815905

Currently the diff-check for `.mp3`-files is failing. The only reason
for that is that right now is that there are too spaces too much on the
last line[1].

[1] https://salsa.debian.org/reproducible-builds/diffoscope/-/blob/175/tests/data/mp3_expected_diff

(cherry picked from commit ea55d23cd8)
2021-05-26 22:35:51 +02:00
Sandro
4a40836097 Merge pull request #124533 from DeterminateSystems/tf-provider-hydra-21.05
[21.05] terraform-providers.hydra: 0.1.0 -> 0.1.1
2021-05-26 22:17:24 +02:00
Cole Helbling
573cdf2df2 terraform-providers.hydra: 0.1.1 -> 0.1.2
(cherry picked from commit 4c7cf79b36)
2021-05-26 12:23:14 -07:00
Robert Scott
169371366d Merge pull request #124477 from LeSuisse/sssd-1.16.5-21.05
[21.05] sssd: 1.16.4 -> 1.16.5
2021-05-26 20:13:31 +01:00
Michele Guerini Rocco
ed35898dd1 Merge pull request #124529 from rnhmjoj/openconnect-21.05
[21.05] openconnect-head: init at 2021-05-05
2021-05-26 21:02:45 +02:00
Robert Scott
8ac5876aac python3Packages.xgboost: fix tests for darwin
(cherry picked from commit 4ef1d33c7c)
2021-05-26 19:22:30 +01:00
Robert Scott
2c8139ee6b devpi-server: set __darwinAllowLocalNetworking
allowing tests to pass on sandboxed darwin

(cherry picked from commit 46e66614d9)
2021-05-26 19:11:21 +01:00
Robert Scott
828cf19e1e devpi-client: set __darwinAllowLocalNetworking
allowing tests to pass on sandboxed darwin

(cherry picked from commit 995d2d87c8)
2021-05-26 19:09:50 +01:00
rnhmjoj
b6f4ae45b7 openconnect: fix license information
The project seems to be licensed under LGPL 2.1 *only*.

(cherry picked from commit 61f556a60b)
2021-05-26 19:43:40 +02:00
rnhmjoj
fc8280a67c openconnect-head: init at 2021-05-05
(cherry picked from commit 2d1090a058)
2021-05-26 19:43:36 +02:00
Gabriel Ebner
84ad09b57b Merge pull request #124518 from collares/olean-backport
[21.05] lean: substitute release commit sha1
2021-05-26 19:22:26 +02:00
Mauricio Collares
97eba634e4 lean: substitute release commit sha1 2021-05-26 13:47:23 -03:00
Michael Weiss
8eb8032b1d signal-desktop: 5.2.1 -> 5.3.0
(cherry picked from commit 5be62dca8c)
2021-05-26 18:13:33 +02:00
Sandro Jäckel
0b4994f714 nixos/kresd: tell resolveconf to use local resolver
(cherry picked from commit 140828ce38)
2021-05-26 17:24:55 +02:00
Harrison Houghton
6ac38da61b pinball: fix
There was an override of autoconfHook to use automake 1.15.x; I'm not
sure what changed since this package was added but it explicitly needs
1.16.1 or greater for the submodule libltdl.

Anyhow, just remove the override.

(cherry picked from commit 3e4aeea693)
2021-05-26 08:07:53 -07:00
Andrew Childs
d2920be368 darwin/make-bootstrap-tools: move "lib" from install name to rpath
The rpath structure for the bootstrap tools was reworked to minimize
the amount of rewriting required on unpack, but the test was not
updated to match the different structure.

Additionally [1] builds that use the bootstrap version of libc++
cannot find libc++abi if the reference includes the "lib"
component (ie, libc++ refers to libc++abi with
@rpath/lib/libc++abi.dylib).

[1] https://logs.nix.samueldr.com/nix-darwin/2021-05-18#4993282

Test failure observed on Hydra: https://hydra.nixos.org/build/143130126

(cherry picked from commit 38207735f4)
2021-05-26 08:05:16 -07:00
Michele Guerini Rocco
677fab12a9 Merge pull request #124488 from rnhmjoj/mpl-21.05
[21.05] pythonPackages.matplotlib: fix headless detection
2021-05-26 14:48:31 +02:00
rnhmjoj
6aa537a98d pythonPackages.matplotlib: add licenses
(cherry picked from commit 7672576a0d)
2021-05-26 14:20:01 +02:00
rnhmjoj
a6ac81209b pythonPackages.matplotlib: remove unsused arguments
(cherry picked from commit 3a3e1134a8)
2021-05-26 14:19:57 +02:00
rnhmjoj
b7ce7d761c pythonPackages.matplotlib: fix headless detection
The default backend is chosen based on the content of the $DISPLAY
variable *and* a successfull call to libX11, loaded via dlopen().
The test fails because dlopen looks in /usr/lib and /lib, so matplotlib
falls back to a headless backend.

To reproduce try running:

    $ nix-shell -I nixpkgs=$PWD -p \
      'python3.withPackages (p: [ p.matplotlib ])' --run python
    >>> import matplotlib.pyplot as plt
    >>> assert plt.get_backend() == "TkAgg"

(cherry picked from commit 7e2ec8f8a1)
2021-05-26 14:19:45 +02:00
Thomas Gerbet
feff71106d sssd: 1.16.4 -> 1.16.5
Fixes CVE-2018-16838.
https://sssd.io/release-notes/sssd-1.16.5.html

(cherry picked from commit affda4029f)
2021-05-26 12:04:22 +02:00
DavHau
97fc742ae6 scikit-learn: disable some tests for darwin
(cherry picked from commit 4af47234fa)
2021-05-26 00:29:23 -07:00
Noah D. Brenowitz
ff776b403a python3Packages.scikitlearn: disable flaky tests
* Disable all tests of the NuSVC estimator that use memmap'd data
* build in serial on darwin

Resolves #121988

(cherry picked from commit cb2891b8c8)
2021-05-26 00:29:23 -07:00
Martin Weinelt
813b3b2a0c Revert "python3Packages.pywemo: disable failing test"
This reverts commit 60c98baf17.

The original issue was a result of a libxml2 regression that has since
been fixed.
2021-05-26 04:56:46 +02:00
Martin Weinelt
af053d10fb Merge remote-tracking branch 'origin/release-21.05' into staging-next-21.05 2021-05-26 04:56:26 +02:00
Martin Weinelt
66fdd3939d home-assistant: disable flaky test in prometheus component
______________________________ test_view[pyloop] _______________________________
[gw49] linux -- Python 3.8.9 /nix/store/7i305r9i4rsb1hmqwkdmphjf430niq3l-python3-3.8.9/bin/python3.8
hass = <homeassistant.core.HomeAssistant object at 0xffff56d041c0>
hass_client = <function hass_client.<locals>.auth_client at 0xffff56a11ca0>
    async def test_view(hass, hass_client):
        """Test prometheus metrics view."""
        client = await prometheus_client(hass, hass_client)
        resp = await client.get(prometheus.API_ENDPOINT)

        assert resp.status == 200
        assert resp.headers["content-type"] == CONTENT_TYPE_TEXT_PLAIN
        body = await resp.text()
        body = body.split("\n")

        assert len(body) > 3

        assert "# HELP python_info Python platform information" in body
        assert (
            "# HELP python_gc_objects_collected_total "
            "Objects collected during gc" in body
        )

        assert (
            'temperature_c{domain="sensor",'
            'entity="sensor.outside_temperature",'
            'friendly_name="Outside Temperature"} 15.6' in body
        )

        assert (
            'battery_level_percent{domain="sensor",'
            'entity="sensor.outside_temperature",'
            'friendly_name="Outside Temperature"} 12.0' in body
        )

        assert (
            'current_temperature_c{domain="climate",'
            'entity="climate.heatpump",'
            'friendly_name="HeatPump"} 25.0' in body
        )

>       assert (
            'humidifier_target_humidity_percent{domain="humidifier",'
            'entity="humidifier.humidifier",'
            'friendly_name="Humidifier"} 68.0' in body
        )
E       assert 'humidifier_target_humidity_percent{domain="humidifier",entity="humidifier.humidifier",friendly_name="Humidifier"} 68.0' in ['# HELP python_gc_objects_collected_total Objects collected during gc', '# TYPE python_gc_objects_collected_total cou...al{generation="2"} 175103.0', '# HELP python_gc_objects_uncollectable_total Uncollectable object found during GC', ...]
tests/components/prometheus/test_init.py:130: AssertionError
---------------------------- Captured stderr setup -----------------------------
DEBUG:asyncio:Using selector: EpollSelector
------------------------------ Captured log setup ------------------------------
DEBUG    asyncio:selector_events.py:59 Using selector: EpollSelector
----------------------------- Captured stderr call -----------------------------
INFO:homeassistant.loader:Loaded prometheus from homeassistant.components.prometheus
INFO:homeassistant.loader:Loaded http from homeassistant.components.http
DEBUG:homeassistant.setup:Dependency prometheus will wait for dependencies ['http']
INFO:homeassistant.setup:Setting up http
INFO:homeassistant.setup:Setup of domain http took 0.0 seconds
DEBUG:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=http>
INFO:homeassistant.setup:Setting up prometheus
INFO:homeassistant.setup:Setup of domain prometheus took 0.0 seconds
DEBUG:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=prometheus>
INFO:homeassistant.loader:Loaded sensor from homeassistant.components.sensor
INFO:homeassistant.loader:Loaded demo from homeassistant.components.demo
INFO:homeassistant.setup:Setting up sensor
INFO:homeassistant.setup:Setup of domain sensor took 0.0 seconds
DEBUG:homeassistant.setup:Dependency demo will wait for dependencies ['conversation', 'zone', 'group']
DEBUG:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=sensor>
INFO:homeassistant.loader:Loaded conversation from homeassistant.components.conversation
INFO:homeassistant.loader:Loaded zone from homeassistant.components.zone
INFO:homeassistant.setup:Setting up conversation
INFO:homeassistant.loader:Loaded group from homeassistant.components.group
DEBUG:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=conversation, service=process>
INFO:homeassistant.setup:Setup of domain conversation took 0.0 seconds
INFO:homeassistant.loader:Loaded climate from homeassistant.components.climate
INFO:homeassistant.setup:Setting up zone
DEBUG:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=conversation>
INFO:homeassistant.setup:Setting up group
INFO:homeassistant.setup:Setting up climate
DEBUG:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=climate, service=turn_on>
DEBUG:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=climate, service=turn_off>
DEBUG:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=climate, service=set_hvac_mode>
DEBUG:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=climate, service=set_preset_mode>
DEBUG:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=climate, service=set_aux_heat>
DEBUG:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=climate, service=set_temperature>
DEBUG:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=climate, service=set_humidity>
DEBUG:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=climate, service=set_fan_mode>
DEBUG:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=climate, service=set_swing_mode>
INFO:homeassistant.setup:Setup of domain climate took 0.0 seconds
DEBUG:homeassistant.setup:Dependency demo will wait for dependencies ['zone', 'group']
DEBUG:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=climate>
DEBUG:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=group, service=reload>
DEBUG:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=group, service=set>
DEBUG:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=group, service=remove>
INFO:homeassistant.setup:Setup of domain group took 0.1 seconds
DEBUG:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=zone, service=reload>
DEBUG:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=group>
DEBUG:homeassistant.core:Bus:Handling <Event state_changed[L]: entity_id=zone.home, old_state=None, new_state=<state zone.home=zoning; latitude=32.87336, longitude=-117.22743, radius=100, passive=False, editable=True, friendly_name=test home, icon=mdi:home @ 2021-05-12T16:02:29.918726+00:00>>
DEBUG:homeassistant.components.prometheus:Handling state update for zone.home
INFO:homeassistant.setup:Setup of domain zone took 0.1 seconds
DEBUG:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=zone>
INFO:homeassistant.setup:Setting up demo
INFO:homeassistant.setup:Setup of domain demo took 0.0 seconds
DEBUG:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=demo>
INFO:homeassistant.components.sensor:Setting up sensor.demo
INFO:homeassistant.components.climate:Setting up climate.demo
INFO:homeassistant.helpers.entity_registry:Registered new sensor.demo entity: sensor.outside_temperature
DEBUG:homeassistant.core:Bus:Handling <Event entity_registry_updated[L]: action=create, entity_id=sensor.outside_temperature>
DEBUG:homeassistant.core:Bus:Handling <Event state_changed[L]: entity_id=sensor.outside_temperature, old_state=None, new_state=<state sensor.outside_temperature=15.6; battery_level=12, unit_of_measurement=°C, friendly_name=Outside Temperature, device_class=temperature @ 2021-05-12T16:02:29.931161+00:00>>
INFO:homeassistant.helpers.entity_registry:Registered new sensor.demo entity: sensor.outside_humidity
DEBUG:homeassistant.core:Bus:Handling <Event entity_registry_updated[L]: action=create, entity_id=sensor.outside_humidity>
DEBUG:homeassistant.core:Bus:Handling <Event state_changed[L]: entity_id=sensor.outside_humidity, old_state=None, new_state=<state sensor.outside_humidity=54; unit_of_measurement=%, friendly_name=Outside Humidity, device_class=humidity @ 2021-05-12T16:02:29.933965+00:00>>
INFO:homeassistant.helpers.entity_registry:Registered new sensor.demo entity: sensor.carbon_monoxide
DEBUG:homeassistant.components.prometheus:Handling state update for sensor.outside_humidity
DEBUG:homeassistant.core:Bus:Handling <Event entity_registry_updated[L]: action=create, entity_id=sensor.carbon_monoxide>
DEBUG:homeassistant.core:Bus:Handling <Event state_changed[L]: entity_id=sensor.carbon_monoxide, old_state=None, new_state=<state sensor.carbon_monoxide=54; unit_of_measurement=ppm, friendly_name=Carbon monoxide, device_class=carbon_monoxide @ 2021-05-12T16:02:29.954947+00:00>>
INFO:homeassistant.helpers.entity_registry:Registered new sensor.demo entity: sensor.carbon_dioxide
DEBUG:homeassistant.components.prometheus:Handling state update for sensor.carbon_monoxide
DEBUG:homeassistant.core:Bus:Handling <Event entity_registry_updated[L]: action=create, entity_id=sensor.carbon_dioxide>
DEBUG:homeassistant.components.prometheus:Handling state update for sensor.outside_temperature
DEBUG:homeassistant.core:Bus:Handling <Event state_changed[L]: entity_id=sensor.carbon_dioxide, old_state=None, new_state=<state sensor.carbon_dioxide=54; battery_level=14, unit_of_measurement=ppm, friendly_name=Carbon dioxide, device_class=carbon_dioxide @ 2021-05-12T16:02:29.958608+00:00>>
INFO:homeassistant.helpers.entity_registry:Registered new climate.demo entity: climate.heatpump
DEBUG:homeassistant.core:Bus:Handling <Event entity_registry_updated[L]: action=create, entity_id=climate.heatpump>
DEBUG:homeassistant.core:Bus:Handling <Event state_changed[L]: entity_id=climate.heatpump, old_state=None, new_state=<state climate.heatpump=heat; hvac_modes=['heat', 'off'], min_temp=7.0, max_temp=35.0, current_temperature=25.0, temperature=20.0, hvac_action=heating, friendly_name=HeatPump, supported_features=1 @ 2021-05-12T16:02:29.970499+00:00>>
DEBUG:homeassistant.components.prometheus:Handling state update for sensor.carbon_dioxide
DEBUG:homeassistant.components.prometheus:Handling state update for climate.heatpump
INFO:homeassistant.helpers.entity_registry:Registered new climate.demo entity: climate.hvac
DEBUG:homeassistant.core:Bus:Handling <Event entity_registry_updated[L]: action=create, entity_id=climate.hvac>
DEBUG:homeassistant.core:Bus:Handling <Event state_changed[L]: entity_id=climate.hvac, old_state=None, new_state=<state climate.hvac=cool; hvac_modes=['off', 'heat', 'cool', 'auto', 'dry', 'fan_only'], min_temp=7, max_temp=35, min_humidity=30, max_humidity=99, fan_modes=['On Low', 'On High', 'Auto Low', 'Auto High', 'Off'], swing_modes=['Auto', '1', '2', '3', 'Off'], current_temperature=22, temperature=21, target_temp_high=None, target_temp_low=None, current_humidity=54, humidity=67, fan_mode=On High, hvac_action=cooling, swing_mode=Off, aux_heat=off, friendly_name=Hvac, supported_features=111 @ 2021-05-12T16:02:29.980988+00:00>>
INFO:homeassistant.helpers.entity_registry:Registered new climate.demo entity: climate.ecobee
DEBUG:homeassistant.core:Bus:Handling <Event entity_registry_updated[L]: action=create, entity_id=climate.ecobee>
DEBUG:homeassistant.core:Bus:Handling <Event state_changed[L]: entity_id=climate.ecobee, old_state=None, new_state=<state climate.ecobee=heat_cool; hvac_modes=['heat_cool', 'cool', 'heat'], min_temp=7, max_temp=35, fan_modes=['On Low', 'On High', 'Auto Low', 'Auto High', 'Off'], preset_modes=['home', 'eco'], swing_modes=['Auto', '1', '2', '3', 'Off'], current_temperature=23, target_temp_high=24, target_temp_low=21, fan_mode=Auto Low, preset_mode=home, swing_mode=Auto, friendly_name=Ecobee, supported_features=58 @ 2021-05-12T16:02:29.984441+00:00>>
DEBUG:homeassistant.components.prometheus:Handling state update for climate.hvac
DEBUG:homeassistant.components.prometheus:Handling state update for climate.ecobee
INFO:homeassistant.loader:Loaded humidifier from homeassistant.components.humidifier
INFO:homeassistant.setup:Setting up humidifier
DEBUG:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=humidifier, service=turn_on>
DEBUG:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=humidifier, service=turn_off>
DEBUG:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=humidifier, service=toggle>
DEBUG:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=humidifier, service=set_mode>
DEBUG:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=humidifier, service=set_humidity>
INFO:homeassistant.setup:Setup of domain humidifier took 0.0 seconds
INFO:homeassistant.components.humidifier:Setting up humidifier.demo
DEBUG:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=humidifier>
DEBUG:homeassistant.core:Bus:Handling <Event state_changed[L]: entity_id=sensor.television_energy, old_state=None, new_state=<state sensor.television_energy=74; unit_of_measurement=kWh, friendly_name=Television Energy @ 2021-05-12T16:02:30.004051+00:00>>
DEBUG:homeassistant.core:Bus:Handling <Event state_changed[L]: entity_id=sensor.radio_energy, old_state=None, new_state=<state sensor.radio_energy=14; unit_of_measurement=kWh, friendly_name=Radio Energy, device_class=power @ 1970-01-02T00:00:00+00:00>>
DEBUG:homeassistant.core:Bus:Handling <Event state_changed[L]: entity_id=sensor.electricity_price, old_state=None, new_state=<state sensor.electricity_price=0.123; unit_of_measurement=SEK/kWh, friendly_name=Electricity price @ 2021-05-12T16:02:30.007311+00:00>>
DEBUG:homeassistant.core:Bus:Handling <Event state_changed[L]: entity_id=sensor.wind_direction, old_state=None, new_state=<state sensor.wind_direction=25; unit_of_measurement=°, friendly_name=Wind Direction @ 2021-05-12T16:02:30.008486+00:00>>
DEBUG:homeassistant.components.prometheus:Handling state update for sensor.television_energy
DEBUG:homeassistant.components.prometheus:Handling state update for sensor.radio_energy
DEBUG:homeassistant.components.prometheus:Handling state update for sensor.electricity_price
DEBUG:homeassistant.components.prometheus:Handling state update for sensor.wind_direction
DEBUG:homeassistant.core:Bus:Handling <Event state_changed[L]: entity_id=sensor.sps30_pm_1um_weight_concentration, old_state=None, new_state=<state sensor.sps30_pm_1um_weight_concentration=3.7069; unit_of_measurement=µg/m³, friendly_name=SPS30 PM <1µm Weight concentration @ 2021-05-12T16:02:30.042774+00:00>>
DEBUG:homeassistant.core:Bus:Handling <Event state_changed[L]: entity_id=humidifier.humidifier, old_state=None, new_state=<state humidifier.humidifier=on; min_humidity=0, max_humidity=100, humidity=68, friendly_name=Humidifier, supported_features=0, device_class=humidifier @ 2021-05-12T16:02:30.048191+00:00>>
DEBUG:homeassistant.core:Bus:Handling <Event state_changed[L]: entity_id=humidifier.dehumidifier, old_state=None, new_state=<state humidifier.dehumidifier=on; min_humidity=0, max_humidity=100, humidity=54, friendly_name=Dehumidifier, supported_features=0, device_class=dehumidifier @ 2021-05-12T16:02:30.049812+00:00>>
DEBUG:homeassistant.core:Bus:Handling <Event state_changed[L]: entity_id=humidifier.hygrostat, old_state=None, new_state=<state humidifier.hygrostat=on; min_humidity=0, max_humidity=100, available_modes=['home', 'eco'], humidity=50, mode=home, friendly_name=Hygrostat, supported_features=1 @ 2021-05-12T16:02:30.051561+00:00>>
DEBUG:homeassistant.components.http.auth:Authenticated 127.0.0.1 for /api/prometheus using bearer token
DEBUG:homeassistant.components.prometheus:Handling state update for sensor.sps30_pm_1um_weight_concentration
DEBUG:homeassistant.components.http.view:Serving /api/prometheus to 127.0.0.1 (auth: True)
DEBUG:homeassistant.components.prometheus:Handling state update for humidifier.hygrostat
DEBUG:homeassistant.components.prometheus:Handling state update for humidifier.dehumidifier
DEBUG:homeassistant.components.prometheus:Handling state update for humidifier.humidifier
DEBUG:homeassistant.components.prometheus:Received Prometheus metrics request
INFO:aiohttp.access:127.0.0.1 [12/May/2021:16:02:30 +0000] "GET /api/prometheus HTTP/1.1" 200 12216 "-" "Python/3.8 aiohttp/3.7.4.post0"
------------------------------ Captured log call -------------------------------
INFO     homeassistant.loader:loader.py:344 Loaded prometheus from homeassistant.components.prometheus
INFO     homeassistant.loader:loader.py:344 Loaded http from homeassistant.components.http
DEBUG    homeassistant.setup:setup.py:130 Dependency prometheus will wait for dependencies ['http']
INFO     homeassistant.setup:setup.py:217 Setting up http
INFO     homeassistant.setup:setup.py:265 Setup of domain http took 0.0 seconds
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event component_loaded[L]: component=http>
INFO     homeassistant.setup:setup.py:217 Setting up prometheus
INFO     homeassistant.setup:setup.py:265 Setup of domain prometheus took 0.0 seconds
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event component_loaded[L]: component=prometheus>
INFO     homeassistant.loader:loader.py:344 Loaded sensor from homeassistant.components.sensor
INFO     homeassistant.loader:loader.py:344 Loaded demo from homeassistant.components.demo
INFO     homeassistant.setup:setup.py:217 Setting up sensor
INFO     homeassistant.setup:setup.py:265 Setup of domain sensor took 0.0 seconds
DEBUG    homeassistant.setup:setup.py:130 Dependency demo will wait for dependencies ['conversation', 'zone', 'group']
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event component_loaded[L]: component=sensor>
INFO     homeassistant.loader:loader.py:344 Loaded conversation from homeassistant.components.conversation
INFO     homeassistant.loader:loader.py:344 Loaded zone from homeassistant.components.zone
INFO     homeassistant.setup:setup.py:217 Setting up conversation
INFO     homeassistant.loader:loader.py:344 Loaded group from homeassistant.components.group
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event service_registered[L]: domain=conversation, service=process>
INFO     homeassistant.setup:setup.py:265 Setup of domain conversation took 0.0 seconds
INFO     homeassistant.loader:loader.py:344 Loaded climate from homeassistant.components.climate
INFO     homeassistant.setup:setup.py:217 Setting up zone
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event component_loaded[L]: component=conversation>
INFO     homeassistant.setup:setup.py:217 Setting up group
INFO     homeassistant.setup:setup.py:217 Setting up climate
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event service_registered[L]: domain=climate, service=turn_on>
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event service_registered[L]: domain=climate, service=turn_off>
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event service_registered[L]: domain=climate, service=set_hvac_mode>
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event service_registered[L]: domain=climate, service=set_preset_mode>
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event service_registered[L]: domain=climate, service=set_aux_heat>
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event service_registered[L]: domain=climate, service=set_temperature>
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event service_registered[L]: domain=climate, service=set_humidity>
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event service_registered[L]: domain=climate, service=set_fan_mode>
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event service_registered[L]: domain=climate, service=set_swing_mode>
INFO     homeassistant.setup:setup.py:265 Setup of domain climate took 0.0 seconds
DEBUG    homeassistant.setup:setup.py:130 Dependency demo will wait for dependencies ['zone', 'group']
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event component_loaded[L]: component=climate>
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event service_registered[L]: domain=group, service=reload>
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event service_registered[L]: domain=group, service=set>
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event service_registered[L]: domain=group, service=remove>
INFO     homeassistant.setup:setup.py:265 Setup of domain group took 0.1 seconds
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event service_registered[L]: domain=zone, service=reload>
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event component_loaded[L]: component=group>
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event state_changed[L]: entity_id=zone.home, old_state=None, new_state=<state zone.home=zoning; latitude=32.87336, longitude=-117.22743, radius=100, passive=False, editable=True, friendly_name=test home, icon=mdi:home @ 2021-05-12T16:02:29.918726+00:00>>
DEBUG    homeassistant.components.prometheus:__init__.py:152 Handling state update for zone.home
INFO     homeassistant.setup:setup.py:265 Setup of domain zone took 0.1 seconds
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event component_loaded[L]: component=zone>
INFO     homeassistant.setup:setup.py:217 Setting up demo
INFO     homeassistant.setup:setup.py:265 Setup of domain demo took 0.0 seconds
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event component_loaded[L]: component=demo>
INFO     homeassistant.components.sensor:entity_platform.py:217 Setting up sensor.demo
INFO     homeassistant.components.climate:entity_platform.py:217 Setting up climate.demo
INFO     homeassistant.helpers.entity_registry:entity_registry.py:297 Registered new sensor.demo entity: sensor.outside_temperature
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event entity_registry_updated[L]: action=create, entity_id=sensor.outside_temperature>
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event state_changed[L]: entity_id=sensor.outside_temperature, old_state=None, new_state=<state sensor.outside_temperature=15.6; battery_level=12, unit_of_measurement=°C, friendly_name=Outside Temperature, device_class=temperature @ 2021-05-12T16:02:29.931161+00:00>>
INFO     homeassistant.helpers.entity_registry:entity_registry.py:297 Registered new sensor.demo entity: sensor.outside_humidity
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event entity_registry_updated[L]: action=create, entity_id=sensor.outside_humidity>
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event state_changed[L]: entity_id=sensor.outside_humidity, old_state=None, new_state=<state sensor.outside_humidity=54; unit_of_measurement=%, friendly_name=Outside Humidity, device_class=humidity @ 2021-05-12T16:02:29.933965+00:00>>
INFO     homeassistant.helpers.entity_registry:entity_registry.py:297 Registered new sensor.demo entity: sensor.carbon_monoxide
DEBUG    homeassistant.components.prometheus:__init__.py:152 Handling state update for sensor.outside_humidity
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event entity_registry_updated[L]: action=create, entity_id=sensor.carbon_monoxide>
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event state_changed[L]: entity_id=sensor.carbon_monoxide, old_state=None, new_state=<state sensor.carbon_monoxide=54; unit_of_measurement=ppm, friendly_name=Carbon monoxide, device_class=carbon_monoxide @ 2021-05-12T16:02:29.954947+00:00>>
INFO     homeassistant.helpers.entity_registry:entity_registry.py:297 Registered new sensor.demo entity: sensor.carbon_dioxide
DEBUG    homeassistant.components.prometheus:__init__.py:152 Handling state update for sensor.carbon_monoxide
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event entity_registry_updated[L]: action=create, entity_id=sensor.carbon_dioxide>
DEBUG    homeassistant.components.prometheus:__init__.py:152 Handling state update for sensor.outside_temperature
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event state_changed[L]: entity_id=sensor.carbon_dioxide, old_state=None, new_state=<state sensor.carbon_dioxide=54; battery_level=14, unit_of_measurement=ppm, friendly_name=Carbon dioxide, device_class=carbon_dioxide @ 2021-05-12T16:02:29.958608+00:00>>
INFO     homeassistant.helpers.entity_registry:entity_registry.py:297 Registered new climate.demo entity: climate.heatpump
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event entity_registry_updated[L]: action=create, entity_id=climate.heatpump>
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event state_changed[L]: entity_id=climate.heatpump, old_state=None, new_state=<state climate.heatpump=heat; hvac_modes=['heat', 'off'], min_temp=7.0, max_temp=35.0, current_temperature=25.0, temperature=20.0, hvac_action=heating, friendly_name=HeatPump, supported_features=1 @ 2021-05-12T16:02:29.970499+00:00>>
DEBUG    homeassistant.components.prometheus:__init__.py:152 Handling state update for sensor.carbon_dioxide
DEBUG    homeassistant.components.prometheus:__init__.py:152 Handling state update for climate.heatpump
INFO     homeassistant.helpers.entity_registry:entity_registry.py:297 Registered new climate.demo entity: climate.hvac
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event entity_registry_updated[L]: action=create, entity_id=climate.hvac>
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event state_changed[L]: entity_id=climate.hvac, old_state=None, new_state=<state climate.hvac=cool; hvac_modes=['off', 'heat', 'cool', 'auto', 'dry', 'fan_only'], min_temp=7, max_temp=35, min_humidity=30, max_humidity=99, fan_modes=['On Low', 'On High', 'Auto Low', 'Auto High', 'Off'], swing_modes=['Auto', '1', '2', '3', 'Off'], current_temperature=22, temperature=21, target_temp_high=None, target_temp_low=None, current_humidity=54, humidity=67, fan_mode=On High, hvac_action=cooling, swing_mode=Off, aux_heat=off, friendly_name=Hvac, supported_features=111 @ 2021-05-12T16:02:29.980988+00:00>>
INFO     homeassistant.helpers.entity_registry:entity_registry.py:297 Registered new climate.demo entity: climate.ecobee
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event entity_registry_updated[L]: action=create, entity_id=climate.ecobee>
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event state_changed[L]: entity_id=climate.ecobee, old_state=None, new_state=<state climate.ecobee=heat_cool; hvac_modes=['heat_cool', 'cool', 'heat'], min_temp=7, max_temp=35, fan_modes=['On Low', 'On High', 'Auto Low', 'Auto High', 'Off'], preset_modes=['home', 'eco'], swing_modes=['Auto', '1', '2', '3', 'Off'], current_temperature=23, target_temp_high=24, target_temp_low=21, fan_mode=Auto Low, preset_mode=home, swing_mode=Auto, friendly_name=Ecobee, supported_features=58 @ 2021-05-12T16:02:29.984441+00:00>>
DEBUG    homeassistant.components.prometheus:__init__.py:152 Handling state update for climate.hvac
DEBUG    homeassistant.components.prometheus:__init__.py:152 Handling state update for climate.ecobee
INFO     homeassistant.loader:loader.py:344 Loaded humidifier from homeassistant.components.humidifier
INFO     homeassistant.setup:setup.py:217 Setting up humidifier
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event service_registered[L]: domain=humidifier, service=turn_on>
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event service_registered[L]: domain=humidifier, service=turn_off>
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event service_registered[L]: domain=humidifier, service=toggle>
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event service_registered[L]: domain=humidifier, service=set_mode>
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event service_registered[L]: domain=humidifier, service=set_humidity>
INFO     homeassistant.setup:setup.py:265 Setup of domain humidifier took 0.0 seconds
INFO     homeassistant.components.humidifier:entity_platform.py:217 Setting up humidifier.demo
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event component_loaded[L]: component=humidifier>
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event state_changed[L]: entity_id=sensor.television_energy, old_state=None, new_state=<state sensor.television_energy=74; unit_of_measurement=kWh, friendly_name=Television Energy @ 2021-05-12T16:02:30.004051+00:00>>
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event state_changed[L]: entity_id=sensor.radio_energy, old_state=None, new_state=<state sensor.radio_energy=14; unit_of_measurement=kWh, friendly_name=Radio Energy, device_class=power @ 1970-01-02T00:00:00+00:00>>
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event state_changed[L]: entity_id=sensor.electricity_price, old_state=None, new_state=<state sensor.electricity_price=0.123; unit_of_measurement=SEK/kWh, friendly_name=Electricity price @ 2021-05-12T16:02:30.007311+00:00>>
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event state_changed[L]: entity_id=sensor.wind_direction, old_state=None, new_state=<state sensor.wind_direction=25; unit_of_measurement=°, friendly_name=Wind Direction @ 2021-05-12T16:02:30.008486+00:00>>
DEBUG    homeassistant.components.prometheus:__init__.py:152 Handling state update for sensor.television_energy
DEBUG    homeassistant.components.prometheus:__init__.py:152 Handling state update for sensor.radio_energy
DEBUG    homeassistant.components.prometheus:__init__.py:152 Handling state update for sensor.electricity_price
DEBUG    homeassistant.components.prometheus:__init__.py:152 Handling state update for sensor.wind_direction
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event state_changed[L]: entity_id=sensor.sps30_pm_1um_weight_concentration, old_state=None, new_state=<state sensor.sps30_pm_1um_weight_concentration=3.7069; unit_of_measurement=µg/m³, friendly_name=SPS30 PM <1µm Weight concentration @ 2021-05-12T16:02:30.042774+00:00>>
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event state_changed[L]: entity_id=humidifier.humidifier, old_state=None, new_state=<state humidifier.humidifier=on; min_humidity=0, max_humidity=100, humidity=68, friendly_name=Humidifier, supported_features=0, device_class=humidifier @ 2021-05-12T16:02:30.048191+00:00>>
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event state_changed[L]: entity_id=humidifier.dehumidifier, old_state=None, new_state=<state humidifier.dehumidifier=on; min_humidity=0, max_humidity=100, humidity=54, friendly_name=Dehumidifier, supported_features=0, device_class=dehumidifier @ 2021-05-12T16:02:30.049812+00:00>>
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event state_changed[L]: entity_id=humidifier.hygrostat, old_state=None, new_state=<state humidifier.hygrostat=on; min_humidity=0, max_humidity=100, available_modes=['home', 'eco'], humidity=50, mode=home, friendly_name=Hygrostat, supported_features=1 @ 2021-05-12T16:02:30.051561+00:00>>
DEBUG    homeassistant.components.http.auth:auth.py:127 Authenticated 127.0.0.1 for /api/prometheus using bearer token
DEBUG    homeassistant.components.prometheus:__init__.py:152 Handling state update for sensor.sps30_pm_1um_weight_concentration
DEBUG    homeassistant.components.http.view:view.py:120 Serving /api/prometheus to 127.0.0.1 (auth: True)
DEBUG    homeassistant.components.prometheus:__init__.py:491 Received Prometheus metrics request
DEBUG    homeassistant.components.prometheus:__init__.py:152 Handling state update for humidifier.hygrostat
INFO     aiohttp.access:web_log.py:206 127.0.0.1 [12/May/2021:16:02:30 +0000] "GET /api/prometheus HTTP/1.1" 200 12216 "-" "Python/3.8 aiohttp/3.7.4.post0"
DEBUG    homeassistant.components.prometheus:__init__.py:152 Handling state update for humidifier.dehumidifier
DEBUG    homeassistant.components.prometheus:__init__.py:152 Handling state update for humidifier.humidifier
--------------------------- Captured stderr teardown ---------------------------
DEBUG:homeassistant.core:Bus:Handling <Event homeassistant_stop[L]>
DEBUG:homeassistant.core:Bus:Handling <Event homeassistant_final_write[L]>
INFO:tests.common:Writing data to auth: {'version': 1, 'key': 'auth', 'data': {'users': [{'id': '7addd24334454b2fa200bec8bca48fb7', 'group_ids': ['system-admin'], 'is_owner': False, 'is_active': True, 'name': 'Mock User', 'system_generated': False}], 'groups': [{'id': 'system-admin', 'name': 'Administrators'}, {'id': 'system-users', 'name': 'Users'}, {'id': 'system-read-only', 'name': 'Read Only'}], 'credentials': [{'id': 'mock-credential-id', 'user_id': '7addd24334454b2fa200bec8bca48fb7', 'auth_provider_type': 'homeassistant', 'auth_provider_id': None, 'data': {'username': 'admin'}}], 'refresh_tokens': [{'id': '6c4c17c1d99848ef922f8e3d91e047e8', 'user_id': '7addd24334454b2fa200bec8bca48fb7', 'client_id': 'https://example.com/app', 'client_name': None, 'client_icon': None, 'token_type': 'normal', 'created_at': '2021-05-12T16:02:29.787536+00:00', 'access_token_expiration': 1800.0, 'token': 'f6360b0454c9a629a55879cf598e44469f96fb84ba590a4e1b54a096289b4fa65ab044f54d56ef38cfac698c26840e6025a67062ca3fc8bfa324093451bf12eb', 'jwt_key': 'e15fba373768d8be7a4c3b4055213e5fa6a9e443bcfe406e519b91f38cffc1fcf8463ffa86ec5b8824591f123f6f7059a4c15dcfcd30db3a673c3b9da4dd9dd3', 'last_used_at': '2021-05-12T16:02:29.787737+00:00', 'last_used_ip': None, 'credential_id': 'mock-credential-id', 'version': '2021.5.3'}]}}
INFO:tests.common:Writing data to core.entity_registry: {'version': 1, 'key': 'core.entity_registry', 'data': {'entities': [{'entity_id': 'sensor.outside_temperature', 'config_entry_id': None, 'device_id': None, 'area_id': None, 'unique_id': 'sensor_1', 'platform': 'demo', 'name': None, 'icon': None, 'disabled_by': None, 'capabilities': None, 'supported_features': 0, 'device_class': 'temperature', 'unit_of_measurement': '°C', 'original_name': 'Outside Temperature', 'original_icon': None}, {'entity_id': 'sensor.outside_humidity', 'config_entry_id': None, 'device_id': None, 'area_id': None, 'unique_id': 'sensor_2', 'platform': 'demo', 'name': None, 'icon': None, 'disabled_by': None, 'capabilities': None, 'supported_features': 0, 'device_class': 'humidity', 'unit_of_measurement': '%', 'original_name': 'Outside Humidity', 'original_icon': None}, {'entity_id': 'sensor.carbon_monoxide', 'config_entry_id': None, 'device_id': None, 'area_id': None, 'unique_id': 'sensor_3', 'platform': 'demo', 'name': None, 'icon': None, 'disabled_by': None, 'capabilities': None, 'supported_features': 0, 'device_class': 'carbon_monoxide', 'unit_of_measurement': 'ppm', 'original_name': 'Carbon monoxide', 'original_icon': None}, {'entity_id': 'sensor.carbon_dioxide', 'config_entry_id': None, 'device_id': None, 'area_id': None, 'unique_id': 'sensor_4', 'platform': 'demo', 'name': None, 'icon': None, 'disabled_by': None, 'capabilities': None, 'supported_features': 0, 'device_class': 'carbon_dioxide', 'unit_of_measurement': 'ppm', 'original_name': 'Carbon dioxide', 'original_icon': None}, {'entity_id': 'climate.heatpump', 'config_entry_id': None, 'device_id': None, 'area_id': None, 'unique_id': 'climate_1', 'platform': 'demo', 'name': None, 'icon': None, 'disabled_by': None, 'capabilities': {'hvac_modes': ['heat', 'off'], 'min_temp': 7.0, 'max_temp': 35.0}, 'supported_features': 1, 'device_class': None, 'unit_of_measurement': None, 'original_name': 'HeatPump', 'original_icon': None}, {'entity_id': 'climate.hvac', 'config_entry_id': None, 'device_id': None, 'area_id': None, 'unique_id': 'climate_2', 'platform': 'demo', 'name': None, 'icon': None, 'disabled_by': None, 'capabilities': {'hvac_modes': ['off', 'heat', 'cool', 'auto', 'dry', 'fan_only'], 'min_temp': 7, 'max_temp': 35, 'min_humidity': 30, 'max_humidity': 99, 'fan_modes': ['On Low', 'On High', 'Auto Low', 'Auto High', 'Off'], 'swing_modes': ['Auto', '1', '2', '3', 'Off']}, 'supported_features': 111, 'device_class': None, 'unit_of_measurement': None, 'original_name': 'Hvac', 'original_icon': None}, {'entity_id': 'climate.ecobee', 'config_entry_id': None, 'device_id': None, 'area_id': None, 'unique_id': 'climate_3', 'platform': 'demo', 'name': None, 'icon': None, 'disabled_by': None, 'capabilities': {'hvac_modes': ['heat_cool', 'cool', 'heat'], 'min_temp': 7, 'max_temp': 35, 'fan_modes': ['On Low', 'On High', 'Auto Low', 'Auto High', 'Off'], 'preset_modes': ['home', 'eco'], 'swing_modes': ['Auto', '1', '2', '3', 'Off']}, 'supported_features': 58, 'device_class': None, 'unit_of_measurement': None, 'original_name': 'Ecobee', 'original_icon': None}]}}
DEBUG:homeassistant.core:Bus:Handling <Event homeassistant_close[L]>
---------------------------- Captured log teardown -----------------------------
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event homeassistant_stop[L]>
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event homeassistant_final_write[L]>
INFO     tests.common:common.py:1013 Writing data to auth: {'version': 1, 'key': 'auth', 'data': {'users': [{'id': '7addd24334454b2fa200bec8bca48fb7', 'group_ids': ['system-admin'], 'is_owner': False, 'is_active': True, 'name': 'Mock User', 'system_generated': False}], 'groups': [{'id': 'system-admin', 'name': 'Administrators'}, {'id': 'system-users', 'name': 'Users'}, {'id': 'system-read-only', 'name': 'Read Only'}], 'credentials': [{'id': 'mock-credential-id', 'user_id': '7addd24334454b2fa200bec8bca48fb7', 'auth_provider_type': 'homeassistant', 'auth_provider_id': None, 'data': {'username': 'admin'}}], 'refresh_tokens': [{'id': '6c4c17c1d99848ef922f8e3d91e047e8', 'user_id': '7addd24334454b2fa200bec8bca48fb7', 'client_id': 'https://example.com/app', 'client_name': None, 'client_icon': None, 'token_type': 'normal', 'created_at': '2021-05-12T16:02:29.787536+00:00', 'access_token_expiration': 1800.0, 'token': 'f6360b0454c9a629a55879cf598e44469f96fb84ba590a4e1b54a096289b4fa65ab044f54d56ef38cfac698c26840e6025a67062ca3fc8bfa324093451bf12eb', 'jwt_key': 'e15fba373768d8be7a4c3b4055213e5fa6a9e443bcfe406e519b91f38cffc1fcf8463ffa86ec5b8824591f123f6f7059a4c15dcfcd30db3a673c3b9da4dd9dd3', 'last_used_at': '2021-05-12T16:02:29.787737+00:00', 'last_used_ip': None, 'credential_id': 'mock-credential-id', 'version': '2021.5.3'}]}}
INFO     tests.common:common.py:1013 Writing data to core.entity_registry: {'version': 1, 'key': 'core.entity_registry', 'data': {'entities': [{'entity_id': 'sensor.outside_temperature', 'config_entry_id': None, 'device_id': None, 'area_id': None, 'unique_id': 'sensor_1', 'platform': 'demo', 'name': None, 'icon': None, 'disabled_by': None, 'capabilities': None, 'supported_features': 0, 'device_class': 'temperature', 'unit_of_measurement': '°C', 'original_name': 'Outside Temperature', 'original_icon': None}, {'entity_id': 'sensor.outside_humidity', 'config_entry_id': None, 'device_id': None, 'area_id': None, 'unique_id': 'sensor_2', 'platform': 'demo', 'name': None, 'icon': None, 'disabled_by': None, 'capabilities': None, 'supported_features': 0, 'device_class': 'humidity', 'unit_of_measurement': '%', 'original_name': 'Outside Humidity', 'original_icon': None}, {'entity_id': 'sensor.carbon_monoxide', 'config_entry_id': None, 'device_id': None, 'area_id': None, 'unique_id': 'sensor_3', 'platform': 'demo', 'name': None, 'icon': None, 'disabled_by': None, 'capabilities': None, 'supported_features': 0, 'device_class': 'carbon_monoxide', 'unit_of_measurement': 'ppm', 'original_name': 'Carbon monoxide', 'original_icon': None}, {'entity_id': 'sensor.carbon_dioxide', 'config_entry_id': None, 'device_id': None, 'area_id': None, 'unique_id': 'sensor_4', 'platform': 'demo', 'name': None, 'icon': None, 'disabled_by': None, 'capabilities': None, 'supported_features': 0, 'device_class': 'carbon_dioxide', 'unit_of_measurement': 'ppm', 'original_name': 'Carbon dioxide', 'original_icon': None}, {'entity_id': 'climate.heatpump', 'config_entry_id': None, 'device_id': None, 'area_id': None, 'unique_id': 'climate_1', 'platform': 'demo', 'name': None, 'icon': None, 'disabled_by': None, 'capabilities': {'hvac_modes': ['heat', 'off'], 'min_temp': 7.0, 'max_temp': 35.0}, 'supported_features': 1, 'device_class': None, 'unit_of_measurement': None, 'original_name': 'HeatPump', 'original_icon': None}, {'entity_id': 'climate.hvac', 'config_entry_id': None, 'device_id': None, 'area_id': None, 'unique_id': 'climate_2', 'platform': 'demo', 'name': None, 'icon': None, 'disabled_by': None, 'capabilities': {'hvac_modes': ['off', 'heat', 'cool', 'auto', 'dry', 'fan_only'], 'min_temp': 7, 'max_temp': 35, 'min_humidity': 30, 'max_humidity': 99, 'fan_modes': ['On Low', 'On High', 'Auto Low', 'Auto High', 'Off'], 'swing_modes': ['Auto', '1', '2', '3', 'Off']}, 'supported_features': 111, 'device_class': None, 'unit_of_measurement': None, 'original_name': 'Hvac', 'original_icon': None}, {'entity_id': 'climate.ecobee', 'config_entry_id': None, 'device_id': None, 'area_id': None, 'unique_id': 'climate_3', 'platform': 'demo', 'name': None, 'icon': None, 'disabled_by': None, 'capabilities': {'hvac_modes': ['heat_cool', 'cool', 'heat'], 'min_temp': 7, 'max_temp': 35, 'fan_modes': ['On Low', 'On High', 'Auto Low', 'Auto High', 'Off'], 'preset_modes': ['home', 'eco'], 'swing_modes': ['Auto', '1', '2', '3', 'Off']}, 'supported_features': 58, 'device_class': None, 'unit_of_measurement': None, 'original_name': 'Ecobee', 'original_icon': None}]}}
DEBUG    homeassistant.core:core.py:709 Bus:Handling <Event homeassistant_close[L]>

(cherry picked from commit df1bf616ae)
2021-05-26 04:54:13 +02:00
Izorkin
65d4fff84d nginxMainline: 1.20.0 -> 1.21.0
(cherry picked from commit 0a7feef809)
2021-05-25 14:52:24 -07:00
Izorkin
6e4f30b5a0 nginxStable: 1.20.0 -> 1.20.1
(cherry picked from commit 919dd5497a)
2021-05-25 14:52:24 -07:00
Michael Weiss
f75079b072 chromium: 90.0.4430.212 -> 91.0.4472.77
https://chromereleases.googleblog.com/2021/05/stable-channel-update-for-desktop_25.html

This update includes 32 security fixes.

CVEs:
CVE-2021-30521 CVE-2021-30522 CVE-2021-30523 CVE-2021-30524
CVE-2021-30525 CVE-2021-30526 CVE-2021-30527 CVE-2021-30528
CVE-2021-30529 CVE-2021-30530 CVE-2021-30531 CVE-2021-30532
CVE-2021-30533 CVE-2021-30534 CVE-2021-30535 CVE-2021-21212
CVE-2021-30536 CVE-2021-30537 CVE-2021-30538 CVE-2021-30539
CVE-2021-30540

(cherry picked from commit e522464f9a)
2021-05-25 14:48:06 -07:00
Martin Weinelt
0a1ddb21f2 Merge pull request #124395 from mweinelt/21.05/python/pywemo
[21.05] python3Packages.pywemo: disable failing test
2021-05-25 23:27:11 +02:00
Milan Pässler
a555872f04 gitlab: 13.11.2 -> 13.12.0
(cherry picked from commit 1ded8ef44e)
2021-05-25 23:00:11 +02:00
Milan Pässler
8418b1397c gitlab: add Gemfile fix to update script
Since some GitLab versions, we need to remove the mail-smtp-pool
dependency from the Gemfile, or do other modifications.
Let's add those changes, that will probably be needed in the next
version as well, to the update script.

(cherry picked from commit 0c8f5b7b44)
2021-05-25 23:00:11 +02:00
lunik1
e3f7168d86 libretro.ppsspp: update to v1.11 and fix build againt ffmpeg 4.4
(cherry picked from commit a5a5088eae)
2021-05-25 16:49:02 +01:00
Zane van Iperen
92e46f3619 navidrome: 0.42.1 -> 0.43.0
(cherry picked from commit 88305beb43)
2021-05-25 08:46:47 -07:00
Martin Weinelt
ab28c480e2 Merge pull request #124326 from sumnerevans/element-1.7.29-backport-21.05
element: 1.7.28 -> 1.7.29 (backport to 21.05)
2021-05-25 17:37:58 +02:00
Martin Weinelt
60c98baf17 python3Packages.pywemo: disable failing test
With libxml2 2.9.12 this test started failing, it was reported upstream
at https://github.com/pywemo/pywemo/issues/268.

(cherry picked from commit a0160c0ae8)
2021-05-25 17:33:29 +02:00
Sumner Evans
c2e9a51cdc element: 1.7.28 -> 1.7.29
(cherry picked from commit cdd56a425c)
2021-05-25 09:22:35 -06:00
Jörg Thalheim
bc71efad3e Merge pull request #124312 from tomfitzhenry/backport-serial-port-docs
[21.05] nixos/manual: document how to install over a serial port
2021-05-25 08:29:17 +01:00
Michael Lingelbach
3f0d62871e girara: fix build on darwin (#124337)
(cherry picked from commit 34a84c4b0e)
2021-05-25 03:15:04 -04:00
Jonathan Ringer
7e49e3ea89 Merge remote-tracking branch 'origin/release-21.05' into staging-next-21.05 2021-05-25 00:02:45 -07:00
Jan Tojnar
1b1608a7b8 libxml2: Work around lxml API misuse
(cherry picked from commit 7099f24c4a)
2021-05-24 23:56:08 -07:00
Jonathan Ringer
befda3568c exempi: disable tests for i686
Unable to find boost unittest framework.

Tests are still ran on the x86_64 platform

(cherry picked from commit 266f6ee63a)
2021-05-24 23:53:37 -07:00
Luka Blaskovic
76e136bb5e rustc: 1_52, use correct llvm version 2021-05-24 23:47:14 -07:00
Graham Christensen
b3a9a3e19f terraform-providers.hydra: 0.1.0 -> 0.1.1
(cherry picked from commit 0e91b031f6)
2021-05-24 18:27:24 -07:00
Tom Fitzhenry
3c0ee5ac10 nixos/manual: document how to install over a serial port
https://github.com/NixOS/nixpkgs/issues/58198
(cherry picked from commit 81e04717e8)
2021-05-25 08:46:20 +10:00
Arnout Engelen
0ef2fe6f77 Merge pull request #124180 from Atemu/backport/minimalIso-remove-ruby2.7
[21.05] minimalIso: remove ruby2.7
2021-05-24 22:29:22 +02:00
Gabriel Ebner
b7f77e07b2 Merge pull request #124272 from gebner/ccls-headers-2105
[21.05] ccls: fix libc++ header path
2021-05-24 18:47:29 +02:00
Gabriel Ebner
baedf2c785 ccls: fix libc++ header path
(cherry picked from commit eef236e8ef)
2021-05-24 17:44:27 +02:00
Domen Kožar
0ae5309111 Merge pull request #124258 from domenkozar/revert-sandbox-path-21.05
Revert "nixos/nix-daemon: fix sandbox-paths option"
2021-05-24 15:37:55 +02:00
regnat
0cebbdf687 Revert "nixos/nix-daemon: fix sandbox-paths option"
This reverts commit aeeee447bc.

(cherry picked from commit 113823669b)
Signed-off-by: Domen Kožar <domen@dev.si>
2021-05-24 15:20:58 +02:00
Michael Weiss
97b94af4eb Merge pull request #124182 from primeos/signal-desktop-backport
[21.05] Revert "signal-desktop: Add a Python wrapper to re-encrypt DBs"
2021-05-24 14:50:37 +02:00
Mario Rodas
3cb8557ce1 Merge pull request #124229 from LeSuisse/redis-6.2.3-21.05
[21.05] redis: 6.2.1 -> 6.2.3
2021-05-24 04:39:06 -05:00
Maximilian Bosch
a4b270df3a Merge pull request #124231 from talyz/21.05-php-dom
[21.05] phpExtensions.dom: fix build
2021-05-24 10:50:16 +02:00
Maximilian Bosch
2bffd5fef9 phpExtensions.dom: fix build
ZHF #122042

(cherry picked from commit 53951c0c14)
2021-05-24 09:24:47 +02:00
Jörg Thalheim
0c67f4a204 odp-dpdk: 1.22.0.0_DPDK_18.11 -> 1.27.0.0_DPDK_19.11
(cherry picked from commit b50d58d988)
2021-05-24 09:18:28 +02:00
Jörg Thalheim
c443ac73f2 pktgen: 19.12.0 -> 21.05.0
(cherry picked from commit 9d002b110e)
2021-05-24 09:18:27 +02:00
Jörg Thalheim
ee76949241 spdk: 20.04.1 -> 21.04
(cherry picked from commit 00a7a0f609)
2021-05-24 09:18:27 +02:00
Jörg Thalheim
40b3403d59 dpdk: 20.05 -> 21.02
(cherry picked from commit a443ea7d01)
2021-05-24 09:18:26 +02:00
Thomas Gerbet
35f631618f redis: 6.2.1 -> 6.2.3
Fixes CVE-2021-29477 and CVE-2021-29478.

https://github.com/redis/redis/blob/6.2.3/00-RELEASENOTES
(cherry picked from commit 0d1b14161a)
2021-05-24 08:44:43 +02:00
Atemu
d77ece7e27 Revert "git: Use asciidoctor instead of asciidoc for manpages"
This reverts commit bbf96d898b.

Removes dependency on ruby 2.7 and isn't much slower.

See https://github.com/NixOS/nixpkgs/pull/123502 for more info

(cherry picked from commit 88c2c543bf)
2021-05-23 22:04:26 +02:00
Atemu
036b557bd9 libndctl: build docs with asciidoc instead of asciidoctor
Removes dependency on ruby 2.7 and isn't much slower

(cherry picked from commit 786579c0b8)
2021-05-23 22:04:25 +02:00
Kerstin Humm
ecff4216d5 imagemagick: 7.0.11-12 -> 7.0.11.13
(cherry picked from commit c2521a6b36)
2021-05-23 09:51:43 -07:00
Kerstin Humm
b0eb9dfebb imagemagick: 7.0.11-9 -> 7.0.11-12
(cherry picked from commit 1738b9877a)
2021-05-23 09:51:43 -07:00
John Ericson
62f3f8954c Merge pull request #124149 from sternenseemann/pkg-config-mangling-21.05
[21.05] pkg-config-wrapper: mangle PKG_CONFIG_PATH{,_FOR_BUILD} correctly
2021-05-23 09:41:39 -07:00
John Ericson
e3dc52bcb2 Merge pull request #124150 from sternenseemann/clang-fix-llvmgold-path-21.05
[21.05] llvmPackages*.clang: fix linker invocation with LLVMgold plugin
2021-05-23 09:26:29 -07:00
Kim Lindberger
df25a8867f Merge pull request #124138 from talyz/21.05-php-iconv-errno
[21.05] php74.extensions.iconv: fix error signalling
2021-05-23 17:48:31 +02:00
Robert Scott
0548d93697 Merge pull request #124145 from dotlambda/igraph-arpack-darwin-blas-paths
[21.05] igraph,arpack: correct libblas.dylib's path on darwin, fixing python3Packages.python-igraph
2021-05-23 16:02:09 +01:00
Guillaume Girol
bfa9bc365d Merge pull request #124148 from hyperfekt/mount-pstore-quiet
nixos/filesystems: condition mount-pstore.service on unmounted /sys/fs/pstore (once more)
2021-05-23 13:52:37 +00:00
Guillaume Girol
1c1e5094d9 Merge pull request #123902 from hyperfekt/mount-pstore-quiet
nixos/filesystems: condition mount-pstore.service on unmounted /sys/fs/pstore

(cherry picked from commit d7555732bc)

Reason: activation throws an error from failing to start the unit
2021-05-23 15:04:41 +02:00
sternenseemann
3a165fda92 llvmPackages*.clang: fix linker invocation with LLVMgold plugin
When using GNU binutils, clang passes the LLVMgold.so plugin to the
linker for certain operations that require special support in the linker
like doing link time optimization (LTO). When passing the plugin to the
linker's command line, clang assumes that llvm and itself are installed
in the same prefix and thus `/path/to/clang/bin/../lib/LLVMgold.so` is
the plugin.

Since we install clang and llvm to separate store paths, this assumption
does not hold. When clang-unwrapped only had a single output, we worked
around this issue by symlinking `$out/lib/LLVMgold.so` to
`${llvm}/lib/LLVMgold.so`. However since we split all llvm packages into
multiple outputs clang's `$out` no longer has a lib directory and clang
can't discover clangs lib output on its own. As a result LTO was broken.

Instead of introducing yet another hack and having a symlink to
LLVMgold.so in `$out/lib` (despite having `$lib/lib` as well), we patch
clang to use a hard coded path to `${libllvm.lib}/lib` for discovering
`LLVMgold.so`.

Resolves #123361.

(cherry picked from commit 3530837417)
2021-05-23 14:48:58 +02:00
sternenseemann
771d69953d pkg-config-wrapper: mangle PKG_CONFIG_PATH{,_FOR_BUILD} correctly
Previously, mangleVarList would be used which would concatenate the
variables using a space as a separator. Paths are however separated by
`:` in PKG_CONFIG_PATH leading to entries being broken.

This is fixed by introducing mangleVarListGeneric which allows us to
specify the desired separator.

Reproducer for the issue prior to this change:

    $ nix-shell -A pkgsLLVM.wayland
    [nix-shell] $ pkg-config --libs expat
    Package expat was not found in the pkg-config search path.
    Perhaps you should add the directory containing `expat.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'expat' found
    $ printf 'Host: %s\nBuild: %s' $PKG_CONFIG_PATH $PKG_CONFIG_PATH_FOR_BUILD
    Host: /nix/store/5h308a4ab8w7prcp8iflh5pnl78mayi2-expat-2.2.10-x86_64-unknown-linux-gnu-dev/lib/pkgconfig:/nix/store/z3y9ska2h4l1map25m195iq577g7g3gz-libxml2-x86_64-unknown-linux-gnu-2.9.12-dev/lib/pkgconfig:/nix/store/lbz5m1s0r7zn0cxvl21czfspli6ribzb-zlib-1.2.11-x86_64-unknown-linux-gnu-dev/lib/pkgconfig:/nix/store/rfhvp8r8n3ygpzh8j0l34lk8hwwi3z0h-libffi-3.3-x86_64-unknown-linux-gnu-dev/lib/pkgconfig
    Build: /nix/store/dw11ywy7qwfz53qisz0dggbgix88jah2-wayland-1.19.0-bin/lib/pkgconfig

strace reveals the issue:

    stat("/nix/store/dw11ywy7qwfz53qisz0dggbgix88jah2-wayland-1.19.0-bin/lib/pkgconfig /nix/store/5h308a4ab8w7prcp8iflh5pnl78mayi2-expat-2.2.10-x86_64-unknown-linux-gnu-dev/lib/pkgconfig/expat-uninstalled.pc", 0x7fff49829fa0) = -1 ENOENT (No such file or directory)

In the pkg-config wrapper $PKG_CONFIG_PATH_FOR_BUILD and
$PKG_CONFIG_PATH are concatenated with a space which leads to two paths
being messed up. This issue likely only affects native cross
compilation.

(cherry picked from commit b11d65c850)
2021-05-23 14:40:00 +02:00
Christian Kögler
7375cb1c0e neovide: Fix build caused by llvm multi output 2021-05-23 14:34:23 +02:00
Robert Scott
b7e6b86c74 igraph: fix libblas.dylib's path on darwin
(cherry picked from commit 73df171f26)
2021-05-23 13:52:32 +02:00
Robert Scott
6514fc8f6b arpack: fix libblas.dylib's path on darwin
(cherry picked from commit 1241d9fae3)
2021-05-23 13:52:32 +02:00
Jan Tojnar
b39ac7cf2b php74.extensions.iconv: fix error signalling
The configure script checks whether iconv supports errno. Unfortunately, on PHP < 8, the test program includes $PHP_ICONV_H_PATH, which defaults to FHS path so it fails to build:

	conftest.c:13:10: fatal error: /usr/include/iconv.h: No such file or directory
	   13 | #include </usr/include/iconv.h>
	      |          ^~~~~~~~~~~~~~~~~~~~~~

That causes the feature check to report a false negative, leading PHP to use a degraded code that returns PHP_ICONV_ERR_UNKNOWN when error occurs, breaking granular error handling in applications.

To prevent this, let’s just include <iconv.h>.

PHP 8 just uses include path so the detection works there: 7bd1d70341

(cherry picked from commit 024243bac4)
2021-05-23 13:13:11 +02:00
Pavol Rusnak
1de0b0e5eb python3Packages.cocotb: 1.5.1 -> 1.5.2
this switches from GitHub to PyPi, because the build requires
a proper release tarball

also PyPi release does contain tests, so we don't strictly require
GitHub checkout

(cherry picked from commit 0f2201119b)
2021-05-23 12:46:56 +02:00
Pavol Rusnak
fadd5dd5ae python3Packages.cocotb-bus: init at 0.1.1
(cherry picked from commit ff555e8f88)
2021-05-23 12:46:48 +02:00
Florian Klink
075ab49dc2 qtwebengine: only set -webengine-webrtc-pipewire with qt >= 5.15
This fails the build of qt514.qtwebengine otherwise:

```
QMAKEPATH=/nix/store/29n056mi3pji6si51b128pa67b1qr7wq-qtbase-5.14.2-dev:/nix/store/g7wady1f1r23wlmy4q1f3b8j2fj5q2sq-qtdeclarative-dev:/nix/store/xfqnh2pma99915d4gsanls68z1jikcpx-qtsvg-dev:/nix/store/zlnsjdj5yv1ivi1miq49j9gp382byl35-qtlocation-dev:/nix/store/lb7cidi60cabpa7swv51xnss9045vqzi-qtmultimedia-dev:/nix/store/jrk6bcqihxwsszwy6rwy2vnfc2sb4rv9-qtwebchannel-dev
qmake PREFIX=/nix/store/pa3jhipp59f6ykh9k8l8z8jf88k52bz8-qtwebengine NIX_OUTPUT_OUT=/nix/store/pa3jhipp59f6ykh9k8l8z8jf88k52bz8-qtwebengine NIX_OUTPUT_DEV=/nix/store/jngs3qilw9iiv97rawb9sb9sd6qdbp2s-qtwebengine-dev NIX_OUTPUT_BIN=/nix/store/91hqv88qvg2wb91lv1h1pd4d8wwrkd5d-qtwebengine-bin NIX_OUTPUT_DOC=/nix/store/jngs3qilw9iiv97rawb9sb9sd6qdbp2s-qtwebengine-dev/share/doc/qt-5.14.2 NIX_OUTPUT_QML=/nix/store/91hqv88qvg2wb91lv1h1pd4d8wwrkd5d-qtwebengine-bin/lib/qt-5.14.2/qml NIX_OUTPUT_PLUGIN=/nix/store/91hqv88qvg2wb91lv1h1pd4d8wwrkd5d-qtwebengine-bin/lib/qt-5.14.2/plugins CONFIG+=release -- -system-ffmpeg -webengine-webrtc-pipewire -proprietary-codecs
Info: creating stash file /build/qtwebengine-everywhere-src-5.14.2/.qmake.stash
Info: creating cache file /build/qtwebengine-everywhere-src-5.14.2/.qmake.cache
ERROR: Unknown command line option '-webengine-webrtc-pipewire'.
builder for '/nix/store/g6dvr7789sswmahlxc6zs5pr8k2g5pgy-qtwebengine.drv' failed with exit code 3
```

Also, only bring in pipewire_0_2 if we enable pipewire support.

(cherry picked from commit 4cbb20402a)
2021-05-23 12:37:07 +02:00
Michael Weiss
13e13349bd Revert "signal-desktop: Add a Python wrapper to re-encrypt DBs"
This reverts commit 45bd7b39a4.

The database for users on NixOS 20.09 is still encrypted so we don't
need this wrapper for users that upgrade from NixOS 20.09 to 21.05.
2021-05-23 11:37:15 +02:00
Vladimír Čunát
ddc60bec55 Merge #123133: curlftpfs: fix sandboxed builds on darwin
(cherry picked from commit 29f57e4752)
2021-05-23 08:19:50 +02:00
Jonathan Ringer
11f5b3279d Merge pull request #124090 from jonringer/backport-staging-next
[21.05] Backport staging next
2021-05-22 19:40:52 -07:00
Jonathan Ringer
8e7956833a Revert "21.11 is Porcupine!"
This reverts commit ff1ded3e20.
2021-05-22 19:08:29 -07:00
Jonathan Ringer
d547493e0c Revert "nixos/doc: add md-to-db.sh, convert "Building Your Own NixOS CD" to CommonMark"
This reverts commit 6c14851943.
2021-05-22 19:08:27 -07:00
Jonathan Ringer
f05e41b6f4 Revert "CODEOWNERS: add ryantm to /nixos/doc"
This reverts commit a67febac45.
2021-05-22 19:08:25 -07:00
Jonathan Ringer
4a974e6695 Revert "nixos/doc: convert "Contributing to this manual" to CommonMark"
This reverts commit 7501467903.
2021-05-22 19:08:23 -07:00
Jonathan Ringer
c294c2fb40 Revert "nixos/doc: add 21.11 release notes stub"
This reverts commit 6543c61311.
2021-05-22 19:08:15 -07:00
Jonathan Ringer
c2bb4bad68 Merge remote-tracking branch 'origin/master' into backport-staging-next
Forgot to merge staging-next into master before branching off.
This is meant to include the additional stabilization changes.
2021-05-22 18:48:23 -07:00
Jonathan Ringer
12c5acf376 21.05 beta release 2021-05-22 17:56:13 -07:00
14989 changed files with 290185 additions and 654647 deletions

69
.github/CODEOWNERS vendored
View File

@@ -19,7 +19,7 @@
# Libraries
/lib @edolstra @nbp @infinisil
/lib/systems @alyssais @nbp @ericson2314 @matthewbauer
/lib/systems @nbp @ericson2314 @matthewbauer
/lib/generators.nix @edolstra @nbp @Profpatsch
/lib/cli.nix @edolstra @nbp @Profpatsch
/lib/debug.nix @edolstra @nbp @Profpatsch
@@ -42,12 +42,6 @@
# Nixpkgs build-support
/pkgs/build-support/writers @lassulus @Profpatsch
# Nixpkgs documentation
/maintainers/scripts/db-to-md.sh @jtojnar @ryantm
/maintainers/scripts/doc @jtojnar @ryantm
/doc/build-aux/pandoc-filters @jtojnar
/doc/contributing/contributing-to-documentation.chapter.md @jtojnar
# NixOS Internals
/nixos/default.nix @nbp @infinisil
/nixos/lib/from-env.nix @nbp @infinisil
@@ -65,7 +59,6 @@
/nixos/doc/manual/development/writing-modules.xml @nbp
/nixos/doc/manual/man-nixos-option.xml @nbp
/nixos/modules/installer/tools/nixos-option.sh @nbp
/nixos/modules/system @dasJ
# NixOS integration test driver
/nixos/lib/test-driver @tfc
@@ -78,32 +71,30 @@
/pkgs/common-updater/scripts/update-source-version @jtojnar
# Python-related code and docs
/maintainers/scripts/update-python-libraries @FRidh
/pkgs/top-level/python-packages.nix @FRidh @jonringer
/pkgs/development/interpreters/python @FRidh
/pkgs/development/python-modules @FRidh @jonringer
/doc/languages-frameworks/python.section.md @FRidh
/pkgs/development/tools/poetry2nix @adisbladis
/pkgs/development/interpreters/python/hooks @FRidh @jonringer @DavHau
/pkgs/development/interpreters/python/conda @DavHau
/maintainers/scripts/update-python-libraries @FRidh
/pkgs/top-level/python-packages.nix @FRidh @jonringer
/pkgs/development/interpreters/python @FRidh
/pkgs/development/python-modules @FRidh @jonringer
/doc/languages-frameworks/python.section.md @FRidh
/pkgs/development/tools/poetry2nix @adisbladis
# Haskell
/doc/languages-frameworks/haskell.section.md @cdepillabout @sternenseemann @maralorn @expipiplus1
/maintainers/scripts/haskell @cdepillabout @sternenseemann @maralorn @expipiplus1
/pkgs/development/compilers/ghc @cdepillabout @sternenseemann @maralorn @expipiplus1
/pkgs/development/haskell-modules @cdepillabout @sternenseemann @maralorn @expipiplus1
/pkgs/test/haskell @cdepillabout @sternenseemann @maralorn @expipiplus1
/pkgs/top-level/release-haskell.nix @cdepillabout @sternenseemann @maralorn @expipiplus1
/pkgs/top-level/haskell-packages.nix @cdepillabout @sternenseemann @maralorn @expipiplus1
/doc/languages-frameworks/haskell.section.md @cdepillabout @sternenseemann @maralorn
/maintainers/scripts/haskell @cdepillabout @sternenseemann @maralorn
/pkgs/development/compilers/ghc @cdepillabout @sternenseemann @maralorn
/pkgs/development/haskell-modules @cdepillabout @sternenseemann @maralorn
/pkgs/test/haskell @cdepillabout @sternenseemann @maralorn
/pkgs/top-level/release-haskell.nix @cdepillabout @sternenseemann @maralorn
/pkgs/top-level/haskell-packages.nix @cdepillabout @sternenseemann @maralorn
# Perl
/pkgs/development/interpreters/perl @volth @stigtsp @zakame
/pkgs/top-level/perl-packages.nix @volth @stigtsp @zakame
/pkgs/development/perl-modules @volth @stigtsp @zakame
/pkgs/development/interpreters/perl @volth @stigtsp
/pkgs/top-level/perl-packages.nix @volth @stigtsp
/pkgs/development/perl-modules @volth @stigtsp
# R
/pkgs/applications/science/math/R @jbedo @bcdarwin
/pkgs/development/r-modules @jbedo @bcdarwin
/pkgs/applications/science/math/R @peti
/pkgs/development/r-modules @peti
# Ruby
/pkgs/development/interpreters/ruby @marsam
@@ -111,7 +102,7 @@
# Rust
/pkgs/development/compilers/rust @Mic92 @LnL7 @zowoq
/pkgs/build-support/rust @andir @zowoq
/pkgs/build-support/rust @andir @danieldk @zowoq
# Darwin-related
/pkgs/stdenv/darwin @NixOS/darwin-maintainers
@@ -188,7 +179,8 @@
/pkgs/top-level/emacs-packages.nix @adisbladis
# Neovim
/pkgs/applications/editors/neovim @jonringer @teto
/pkgs/applications/editors/neovim @jonringer
/pkgs/applications/editors/neovim @teto
# VimPlugins
/pkgs/misc/vim-plugins @jonringer @softinio
@@ -202,12 +194,12 @@
/nixos/tests/prometheus-exporters.nix @WilliButz
# PHP interpreter, packages, extensions, tests and documentation
/doc/languages-frameworks/php.section.md @NixOS/php @aanderse @etu @globin @ma27 @talyz
/nixos/tests/php @NixOS/php @aanderse @etu @globin @ma27 @talyz
/pkgs/build-support/build-pecl.nix @NixOS/php @aanderse @etu @globin @ma27 @talyz
/pkgs/development/interpreters/php @jtojnar @NixOS/php @aanderse @etu @globin @ma27 @talyz
/pkgs/development/php-packages @NixOS/php @aanderse @etu @globin @ma27 @talyz
/pkgs/top-level/php-packages.nix @jtojnar @NixOS/php @aanderse @etu @globin @ma27 @talyz
/doc/languages-frameworks/php.section.md @NixOS/php
/nixos/tests/php @NixOS/php
/pkgs/build-support/build-pecl.nix @NixOS/php
/pkgs/development/interpreters/php @NixOS/php
/pkgs/development/php-packages @NixOS/php
/pkgs/top-level/php-packages.nix @NixOS/php
# Podman, CRI-O modules and related
/nixos/modules/virtualisation/containers.nix @NixOS/podman @zowoq
@@ -232,8 +224,3 @@
# Cinnamon
/pkgs/desktops/cinnamon @mkg20001
#nim
/pkgs/development/compilers/nim @ehmry
/pkgs/development/nim-packages @ehmry
/pkgs/top-level/nim-packages.nix @ehmry

View File

@@ -1,7 +1,7 @@
# How to contribute
Note: contributing implies licensing those contributions
under the terms of [COPYING](COPYING), which is an MIT-like license.
under the terms of [COPYING](../COPYING), which is an MIT-like license.
## Opening issues
@@ -59,27 +59,6 @@ Follow these steps to backport a change into a release branch in compliance with
5. Push to GitHub and open a backport pull request. Make sure to select the release branch (e.g. `release-20.09`) as the target branch of the pull request, and link to the pull request in which the original change was comitted to `master`. The pull request title should be the commit title with the release version as prefix, e.g. `[20.09]`.
6. When the backport pull request is merged and you have the necessary privileges you can also replace the label `9.needs: port to stable` with `8.has: port to stable` on the original pull request. This way maintainers can keep track of missing backports easier.
## Criteria for Backporting changes
Anything that does not cause user or downstream dependency regressions can be backported. This includes:
- New Packages / Modules
- Security / Patch updates
- Version updates which include new functionality (but no breaking changes)
- Services which require a client to be up-to-date regardless. (E.g. `spotify`, `steam`, or `discord`)
- Security critical applications (E.g. `firefox`)
## Generating 21.11 Release Notes
(This section also applies to backporting 21.05 release notes: substitute "rl-2111" for "rl-2105".)
Documentation in nixpkgs is transitioning to a markdown-centric workflow. Release notes now require a translation step to convert from markdown to a compatible docbook document.
Steps for updating 21.11 Release notes:
1. Edit `nixos/doc/manual/release-notes/rl-2111.section.md` with the desired changes
2. Run `./nixos/doc/manual/md-to-db.sh` to render `nixos/doc/manual/from_md/release-notes/rl-2111.section.xml`
3. Include changes to `rl-2111.section.md` and `rl-2111.section.xml` in the same commit.
## Reviewing contributions
See the nixpkgs manual for more details on how to [Review contributions](https://nixos.org/nixpkgs/manual/#chap-reviewing-contributions).

View File

@@ -7,38 +7,33 @@ assignees: ''
---
### Describe the bug
**Describe the bug**
A clear and concise description of what the bug is.
### Steps To Reproduce
**To Reproduce**
Steps to reproduce the behavior:
1. ...
2. ...
3. ...
### Expected behavior
**Expected behavior**
A clear and concise description of what you expected to happen.
### Screenshots
**Screenshots**
If applicable, add screenshots to help explain your problem.
### Additional context
**Additional context**
Add any other context about the problem here.
### Notify maintainers
**Notify maintainers**
<!--
Please @ people who are in the `meta.maintainers` list of the offending package or module.
If in doubt, check `git blame` for whoever last touched something.
-->
### Metadata
**Metadata**
Please run `nix-shell -p nix-info --run "nix-info -m"` and paste the result.
```console
[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
output here
```
Maintainer information:
```yaml
# a list of nixpkgs attributes affected by the problem

View File

@@ -15,21 +15,13 @@ Reviewing guidelines: https://nixos.org/manual/nixpkgs/unstable/#chap-reviewing-
<!-- Please check what applies. Note that these are not hard requirements but merely serve as information for reviewers. -->
- [ ] Tested using sandboxing ([nix.useSandbox](https://nixos.org/nixos/manual/options.html#opt-nix.useSandbox) on NixOS, or option `sandbox` in [`nix.conf`](https://nixos.org/nix/manual/#sec-conf-file) on non-NixOS linux)
- Built on platform(s)
- [ ] x86_64-linux
- [ ] aarch64-linux
- [ ] x86_64-darwin
- [ ] aarch64-darwin
- [ ] For non-Linux: Is `sandbox = true` set in `nix.conf`? (See [Nix manual](https://nixos.org/manual/nix/stable/#sec-conf-file))
- [ ] Tested, as applicable:
- [NixOS test(s)](https://nixos.org/manual/nixos/unstable/index.html#sec-nixos-tests) (look inside [nixos/tests](https://github.com/NixOS/nixpkgs/blob/master/nixos/tests))
- and/or [package tests](https://nixos.org/manual/nixpkgs/unstable/#sec-package-tests)
- or, for functions and "core" functionality, tests in [lib/tests](https://github.com/NixOS/nixpkgs/blob/master/lib/tests) or [pkgs/test](https://github.com/NixOS/nixpkgs/blob/master/pkgs/test)
- made sure NixOS tests are [linked](https://nixos.org/manual/nixpkgs/unstable/#ssec-nixos-tests-linking) to the relevant packages
- [ ] Tested compilation of all packages that depend on this change using `nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"`. Note: all changes have to be committed, also see [nixpkgs-review usage](https://github.com/Mic92/nixpkgs-review#usage)
- [ ] Tested basic functionality of all binary files (usually in `./result/bin/`)
- [21.11 Release Notes (or backporting 21.05 Release notes)](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#generating-2111-release-notes)
- [ ] (Package updates) Added a release notes entry if the change is major or breaking
- [ ] (Module updates) Added a release notes entry if the change is significant
- [ ] (Module addition) Added a release notes entry if adding a new NixOS module
- [ ] Fits [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md).
- [ ] NixOS
- [ ] macOS
- [ ] other Linux distributions
- [ ] Tested via one or more NixOS test(s) if existing and applicable for the change (look inside [nixos/tests](https://github.com/NixOS/nixpkgs/blob/master/nixos/tests))
- [ ] Tested compilation of all pkgs that depend on this change using `nix-shell -p nixpkgs-review --run "nixpkgs-review wip"`
- [ ] Tested execution of all binary files (usually in `./result/bin/`)
- [ ] Added a release notes entry if the change is major or breaking
- [ ] Fits [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/.github/CONTRIBUTING.md).

View File

@@ -3,7 +3,7 @@
- Thanks for your contribution!
- To remove the stale label, just leave a new comment.
- _How to find the right people to ping?_ &rarr; [`git blame`](https://git-scm.com/docs/git-blame) to the rescue! (or GitHub's history and blame buttons.)
- You can always ask for help on [our Discourse Forum](https://discourse.nixos.org/), [our Matrix room](https://matrix.to/#/#nix:nixos.org), or on the [#nixos IRC channel](https://web.libera.chat/#nixos).
- You can always ask for help on [our Discourse Forum](https://discourse.nixos.org/) or on the [#nixos IRC channel](https://webchat.freenode.net/#nixos).
## Suggestions for PRs

7
.github/labeler.yml vendored
View File

@@ -70,13 +70,6 @@
"6.topic: nixos":
- nixos/**/*
- pkgs/os-specific/linux/nixos-rebuild/**/*
"6.topic: nim":
- doc/languages-frameworks/nim.section.md
- pkgs/development/compilers/nim/*
- pkgs/development/nim-packages/**/*
- pkgs/top-level/nim-packages.nix
"6.topic: ocaml":
- doc/languages-frameworks/ocaml.section.md

View File

@@ -1,29 +0,0 @@
name: Backport
on:
pull_request_target:
types: [closed, labeled]
jobs:
backport:
name: Backport Pull Request
if: github.repository_owner == 'NixOS' && github.event.pull_request.merged == true && (github.event_name != 'labeled' || startsWith('backport', github.event.label.name))
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# required to find all branches
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}
- name: Create backport PRs
# should be kept in sync with `version`
uses: zeebe-io/backport-action@v0.0.5
with:
# Config README: https://github.com/zeebe-io/backport-action#backport-action
github_token: ${{ secrets.GITHUB_TOKEN }}
github_workspace: ${{ github.workspace }}
# should be kept in sync with `uses`
version: v0.0.5
pull_description: |-
Bot-based backport to `${target_branch}`, triggered by a label in #${pull_number}.
* [ ] Before merging, ensure that this backport complies with the [Criteria for Backporting](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#criteria-for-backporting-changes).
* Even as a non-commiter, if you find that it does not comply, leave a comment.

View File

@@ -1,20 +0,0 @@
name: Basic evaluation checks
on:
pull_request:
branches:
- master
- release-**
push:
branches:
- master
- release-**
jobs:
tests:
runs-on: ubuntu-latest
# we don't limit this action to only NixOS repo since the checks are cheap and useful developer feedback
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v15
# explicit list of supportedSystems is needed until aarch64-darwin becomes part of the trunk jobset
- run: nix-build pkgs/top-level/release.nix -A tarball.nixpkgs-basic-release-checks --arg supportedSystems '[ "aarch64-darwin" "aarch64-linux" "x86_64-linux" "x86_64-darwin" ]'

View File

@@ -17,9 +17,6 @@ jobs:
run: |
ISMERGE=$(curl -H 'Accept: application/vnd.github.groot-preview+json' -H "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ env.GITHUB_REPOSITORY }}/commits/${{ env.GITHUB_SHA }}/pulls | jq -r '.[] | select(.merge_commit_sha == "${{ env.GITHUB_SHA }}") | any')
echo "::set-output name=ismerge::$ISMERGE"
# github events are eventually consistent, so wait until changes propagate to thier DB
- run: sleep 60
if: steps.ismerge.outputs.ismerge != 'true'
- name: Warn if the commit was a direct push
if: steps.ismerge.outputs.ismerge != 'true'
uses: peter-evans/commit-comment@v1

View File

@@ -28,7 +28,7 @@ jobs:
# pull_request_target checks out the base branch by default
ref: refs/pull/${{ github.event.pull_request.number }}/merge
if: env.PR_DIFF
- uses: cachix/install-nix-action@v15
- uses: cachix/install-nix-action@v13
if: env.PR_DIFF
with:
# nixpkgs commit is pinned so that it doesn't break

View File

@@ -12,17 +12,16 @@ on:
jobs:
nixos:
runs-on: ubuntu-latest
if: github.repository_owner == 'NixOS'
steps:
- uses: actions/checkout@v2
with:
# pull_request_target checks out the base branch by default
ref: refs/pull/${{ github.event.pull_request.number }}/merge
- uses: cachix/install-nix-action@v15
- uses: cachix/install-nix-action@v13
with:
# explicitly enable sandbox
extra_nix_config: sandbox = true
- uses: cachix/cachix-action@v10
- uses: cachix/cachix-action@v9
with:
# This cache is for the nixos/nixpkgs manual builds and should not be trusted or used elsewhere.
name: nixpkgs-ci

View File

@@ -12,17 +12,16 @@ on:
jobs:
nixpkgs:
runs-on: ubuntu-latest
if: github.repository_owner == 'NixOS'
steps:
- uses: actions/checkout@v2
with:
# pull_request_target checks out the base branch by default
ref: refs/pull/${{ github.event.pull_request.number }}/merge
- uses: cachix/install-nix-action@v15
- uses: cachix/install-nix-action@v13
with:
# explicitly enable sandbox
extra_nix_config: sandbox = true
- uses: cachix/cachix-action@v10
- uses: cachix/cachix-action@v9
with:
# This cache is for the nixos/nixpkgs manual builds and should not be trusted or used elsewhere.
name: nixpkgs-ci

41
.github/workflows/merge-staging.yml vendored Normal file
View File

@@ -0,0 +1,41 @@
name: "merge staging(-next)"
on:
schedule:
# * is a special character in YAML so you have to quote this string
# Merge every 6 hours
- cron: '0 */6 * * *'
jobs:
sync-branch:
if: github.repository == 'NixOS/nixpkgs'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Merge master into staging-next
id: staging_next
uses: devmasx/merge-branch@v1.3.1
with:
type: now
from_branch: master
target_branch: staging-next
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Merge staging-next into staging
id: staging
uses: devmasx/merge-branch@v1.3.1
with:
type: now
from_branch: staging-next
target_branch: staging
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Comment on failure
uses: peter-evans/create-or-update-comment@v1
if: ${{ failure() }}
with:
issue-number: 105153
body: |
An automatic merge${{ (steps.staging_next.outcome == 'failure' && ' from master to staging-next') || ((steps.staging.outcome == 'failure' && ' from staging-next to staging') || '') }} [failed](https://github.com/NixOS/nixpkgs/actions/runs/${{ github.run_id }}).

View File

@@ -1,26 +0,0 @@
name: NixOS manual checks
permissions: read-all
on:
pull_request_target:
branches-ignore:
- 'release-**'
paths:
- 'nixos/**/*.xml'
- 'nixos/**/*.md'
jobs:
tests:
runs-on: ubuntu-latest
if: github.repository_owner == 'NixOS'
steps:
- uses: actions/checkout@v2
with:
# pull_request_target checks out the base branch by default
ref: refs/pull/${{ github.event.pull_request.number }}/merge
- uses: cachix/install-nix-action@v15
- name: Check DocBook files generated from Markdown are consistent
run: |
nixos/doc/manual/md-to-db.sh
git diff --exit-code

View File

@@ -1,21 +0,0 @@
name: "No channel PR"
on:
pull_request:
branches:
- 'nixos-**'
- 'nixpkgs-**'
jobs:
fail:
name: "This PR is is targeting a channel branch"
runs-on: ubuntu-latest
steps:
- run: |
cat <<EOF
The nixos-* and nixpkgs-* branches are pushed to by the channel
release script and should not be merged into directly.
Please target the equivalent release-* branch or master instead.
EOF
exit 1

View File

@@ -1,53 +0,0 @@
# This action periodically merges base branches into staging branches.
# This is done to
# * prevent conflicts or rather resolve them early
# * make all potential breakage happen on the staging branch
# * and make sure that all major rebuilds happen before the staging
# branch gets merged back into its base branch.
name: "Periodic Merges (24h)"
on:
schedule:
# * is a special character in YAML so you have to quote this string
# Merge every 24 hours
- cron: '0 0 * * *'
jobs:
periodic-merge:
if: github.repository_owner == 'NixOS'
runs-on: ubuntu-latest
strategy:
# don't fail fast, so that all pairs are tried
fail-fast: false
# certain branches need to be merged in order, like master->staging-next->staging
# and disabling parallelism ensures the order of the pairs below.
max-parallel: 1
matrix:
pairs:
- from: master
into: haskell-updates
- from: release-21.05
into: staging-next-21.05
- from: staging-next-21.05
into: staging-21.05
name: ${{ matrix.pairs.from }} → ${{ matrix.pairs.into }}
steps:
- uses: actions/checkout@v2
- name: ${{ matrix.pairs.from }} → ${{ matrix.pairs.into }}
uses: devmasx/merge-branch@1.4.0
with:
type: now
from_branch: ${{ matrix.pairs.from }}
target_branch: ${{ matrix.pairs.into }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Comment on failure
uses: peter-evans/create-or-update-comment@v1
if: ${{ failure() }}
with:
issue-number: 105153
body: |
Periodic merge from `${{ matrix.pairs.from }}` into `${{ matrix.pairs.into }}` has [failed](https://github.com/NixOS/nixpkgs/actions/runs/${{ github.run_id }}).

View File

@@ -1,51 +0,0 @@
# This action periodically merges base branches into staging branches.
# This is done to
# * prevent conflicts or rather resolve them early
# * make all potential breakage happen on the staging branch
# * and make sure that all major rebuilds happen before the staging
# branch gets merged back into its base branch.
name: "Periodic Merges (6h)"
on:
schedule:
# * is a special character in YAML so you have to quote this string
# Merge every 6 hours
- cron: '0 */6 * * *'
jobs:
periodic-merge:
if: github.repository_owner == 'NixOS'
runs-on: ubuntu-latest
strategy:
# don't fail fast, so that all pairs are tried
fail-fast: false
# certain branches need to be merged in order, like master->staging-next->staging
# and disabling parallelism ensures the order of the pairs below.
max-parallel: 1
matrix:
pairs:
- from: master
into: staging-next
- from: staging-next
into: staging
name: ${{ matrix.pairs.from }} → ${{ matrix.pairs.into }}
steps:
- uses: actions/checkout@v2
- name: ${{ matrix.pairs.from }} → ${{ matrix.pairs.into }}
uses: devmasx/merge-branch@1.4.0
with:
type: now
from_branch: ${{ matrix.pairs.from }}
target_branch: ${{ matrix.pairs.into }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Comment on failure
uses: peter-evans/create-or-update-comment@v1
if: ${{ failure() }}
with:
issue-number: 105153
body: |
Periodic merge from `${{ matrix.pairs.from }}` into `${{ matrix.pairs.into }}` has [failed](https://github.com/NixOS/nixpkgs/actions/runs/${{ github.run_id }}).

134
.github/workflows/rebase.yml vendored Normal file
View File

@@ -0,0 +1,134 @@
on:
issue_comment:
types:
- created
# This action allows people with write access to the repo to rebase a PRs base branch
# by commenting `/rebase ${branch}` on the PR while avoiding CODEOWNER notifications.
jobs:
rebase:
runs-on: ubuntu-latest
if: github.repository_owner == 'NixOS' && github.event.issue.pull_request != '' && contains(github.event.comment.body, '/rebase')
steps:
- uses: peter-evans/create-or-update-comment@v1
with:
comment-id: ${{ github.event.comment.id }}
reactions: eyes
- uses: scherermichael-oss/action-has-permission@1.0.6
id: check-write-access
with:
required-permission: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: check permissions
run: |
echo "Commenter doesn't have write access to the repo"
exit 1
if: "! steps.check-write-access.outputs.has-permission"
- name: setup
run: |
curl "https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.issue.number }}" 2>/dev/null >pr.json
cat <<EOF >>"$GITHUB_ENV"
CAN_MODIFY=$(jq -r '.maintainer_can_modify' pr.json)
COMMITS=$(jq -r '.commits' pr.json)
CURRENT_BASE=$(jq -r '.base.ref' pr.json)
PR_BRANCH=$(jq -r '.head.ref' pr.json)
COMMENT_BRANCH=$(echo ${{ github.event.comment.body }} | awk "/^\/rebase / {print \$2}")
PULL_REQUEST=${{ github.event.issue.number }}
EOF
rm pr.json
- name: check branch
env:
PERMANENT_BRANCHES: "haskell-updates|master|nixos|nixpkgs|python-unstable|release|staging"
VALID_BRANCHES: "haskell-updates|master|python-unstable|release-20.09|staging|staging-20.09|staging-next"
run: |
message() {
cat <<EOF
Can't rebase $PR_BRANCH from $CURRENT_BASE onto $COMMENT_BRANCH (PR:$PULL_REQUEST COMMITS:$COMMITS)
EOF
}
if ! [[ "$COMMENT_BRANCH" =~ ^($VALID_BRANCHES)$ ]]; then
cat <<EOF
Check that the branch from the comment is valid:
$(message)
This action can only rebase onto these branches:
$VALID_BRANCHES
\`/rebase \${branch}\` must be at the start of the line
EOF
exit 1
fi
if [[ "$COMMENT_BRANCH" == "$CURRENT_BASE" ]]; then
cat <<EOF
Check that the branch from the comment isn't the current base branch:
$(message)
EOF
exit 1
fi
if [[ "$COMMENT_BRANCH" == "$PR_BRANCH" ]]; then
cat <<EOF
Check that the branch from the comment isn't the current branch:
$(message)
EOF
exit 1
fi
if [[ "$PR_BRANCH" =~ ^($PERMANENT_BRANCHES) ]]; then
cat <<EOF
Check that the PR branch isn't a permanent branch:
$(message)
EOF
exit 1
fi
if [[ "$CAN_MODIFY" != "true" ]]; then
cat <<EOF
Check that maintainers can edit the PR branch:
$(message)
EOF
exit 1
fi
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: rebase pull request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git fetch origin
gh pr checkout "$PULL_REQUEST"
git rebase \
--onto="$(git merge-base origin/"$CURRENT_BASE" origin/"$COMMENT_BRANCH")" \
"HEAD~$COMMITS"
git push --force
curl \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token $GITHUB_TOKEN" \
-d "{ \"base\": \"$COMMENT_BRANCH\" }" \
"https://api.github.com/repos/${{ github.repository }}/pulls/$PULL_REQUEST"
curl \
-X PATCH \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token $GITHUB_TOKEN" \
-d '{ "state": "closed" }' \
"https://api.github.com/repos/${{ github.repository }}/pulls/$PULL_REQUEST"
- uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{ github.event.issue.number }}
body: |
Rebased, please reopen the pull request to restart CI
- uses: peter-evans/create-or-update-comment@v1
if: failure()
with:
issue-number: ${{ github.event.issue.number }}
body: |
[Failed to rebase](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})

1
.gitignore vendored
View File

@@ -2,7 +2,6 @@
,*
.*.swp
.*.swo
.idea/
result
result-*
/doc/NEWS.html

View File

@@ -1 +1 @@
21.11
21.05

View File

@@ -8,7 +8,7 @@
</p>
[Nixpkgs](https://github.com/nixos/nixpkgs) is a collection of over
80,000 software packages that can be installed with the
60,000 software packages that can be installed with the
[Nix](https://nixos.org/nix/) package manager. It also implements
[NixOS](https://nixos.org/nixos/), a purely-functional Linux distribution.
@@ -21,10 +21,10 @@
# Community
* [Discourse Forum](https://discourse.nixos.org/)
* [Matrix Chat](https://matrix.to/#/#community:nixos.org)
* [IRC - #nixos on freenode.net](irc://irc.freenode.net/#nixos)
* [NixOS Weekly](https://weekly.nixos.org/)
* [Community-maintained wiki](https://nixos.wiki/)
* [Community-maintained list of ways to get in touch](https://nixos.wiki/wiki/Get_In_Touch#Chat) (Discord, Telegram, IRC, etc.)
* [Community-maintained list of ways to get in touch](https://nixos.wiki/wiki/Get_In_Touch#Chat) (Discord, Matrix, Telegram, other IRC channels, etc.)
# Other Project Repositories
@@ -46,14 +46,14 @@ Nixpkgs and NixOS are built and tested by our continuous integration
system, [Hydra](https://hydra.nixos.org/).
* [Continuous package builds for unstable/master](https://hydra.nixos.org/jobset/nixos/trunk-combined)
* [Continuous package builds for the NixOS 21.05 release](https://hydra.nixos.org/jobset/nixos/release-21.05)
* [Continuous package builds for the NixOS 20.09 release](https://hydra.nixos.org/jobset/nixos/release-20.09)
* [Tests for unstable/master](https://hydra.nixos.org/job/nixos/trunk-combined/tested#tabs-constituents)
* [Tests for the NixOS 21.05 release](https://hydra.nixos.org/job/nixos/release-21.05/tested#tabs-constituents)
* [Tests for the NixOS 20.09 release](https://hydra.nixos.org/job/nixos/release-20.09/tested#tabs-constituents)
Artifacts successfully built with Hydra are published to cache at
https://cache.nixos.org/. When successful build and test criteria are
met, the Nixpkgs expressions are distributed via [Nix
channels](https://nixos.org/manual/nix/stable/package-management/channels.html).
channels](https://nixos.org/nix/manual/#sec-channels).
# Contributing
@@ -87,7 +87,7 @@ Most contributions are based on and merged into these branches:
deemed of sufficiently high quality
For more information about contributing to the project, please visit
the [contributing page](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md).
the [contributing page](https://github.com/NixOS/nixpkgs/blob/master/.github/CONTRIBUTING.md).
# Donations
@@ -97,8 +97,7 @@ Foundation](https://nixos.org/nixos/foundation.html). To ensure the
continuity and expansion of the NixOS infrastructure, we are looking
for donations to our organization.
You can donate to the NixOS foundation through [SEPA bank
transfers](https://nixos.org/donate.html) or by using Open Collective:
You can donate to the NixOS foundation by using Open Collective:
<a href="https://opencollective.com/nixos#support"><img src="https://opencollective.com/nixos/tiers/supporter.svg?width=890" /></a>

View File

@@ -1,21 +1,5 @@
MD_TARGETS=$(addsuffix .xml, $(basename $(shell find . -type f -regex '.*\.md$$' -not -name README.md)))
PANDOC ?= pandoc
pandoc_media_dir = media
# NOTE: Keep in sync with NixOS manual (/nixos/doc/manual/md-to-db.sh) and conversion script (/maintainers/scripts/db-to-md.sh).
# TODO: Remove raw-attribute when we can get rid of DocBook altogether.
pandoc_commonmark_enabled_extensions = +attributes+fenced_divs+footnotes+bracketed_spans+definition_lists+pipe_tables+raw_attribute
# Not needed:
# - docbook-reader/citerefentry-to-rst-role.lua (only relevant for DocBook → MarkDown/rST/MyST)
pandoc_flags = --extract-media=$(pandoc_media_dir) \
--lua-filter=$(PANDOC_LUA_FILTERS_DIR)/diagram-generator.lua \
--lua-filter=build-aux/pandoc-filters/myst-reader/roles.lua \
--lua-filter=build-aux/pandoc-filters/link-unix-man-references.lua \
--lua-filter=build-aux/pandoc-filters/docbook-writer/rst-roles.lua \
--lua-filter=build-aux/pandoc-filters/docbook-writer/labelless-link-is-xref.lua \
-f commonmark$(pandoc_commonmark_enabled_extensions)+smart
.PHONY: all
all: validate format out/html/index.html out/epub/manual.epub
@@ -38,7 +22,7 @@ fix-misc-xml:
.PHONY: clean
clean:
rm -f ${MD_TARGETS} doc-support/result .version manual-full.xml functions/library/locations.xml functions/library/generated
rm -rf ./out/ ./highlightjs ./media
rm -rf ./out/ ./highlightjs
.PHONY: validate
validate: manual-full.xml doc-support/result
@@ -55,7 +39,7 @@ out/html/index.html: doc-support/result manual-full.xml style.css highlightjs
mkdir -p out/html/highlightjs/
cp -r highlightjs out/html/
cp -r $(pandoc_media_dir) out/html/
cp -r media out/html/
cp ./overrides.css out/html/
cp ./style.css out/html/style.css
@@ -70,7 +54,7 @@ out/epub/manual.epub: manual-full.xml
doc-support/result/epub.xsl \
./manual-full.xml
cp -r $(pandoc_media_dir) out/epub/scratch/OEBPS
cp -r media out/epub/scratch/OEBPS
cp ./overrides.css out/epub/scratch/OEBPS
cp ./style.css out/epub/scratch/OEBPS
mkdir -p out/epub/scratch/OEBPS/images/callouts/
@@ -105,12 +89,16 @@ functions/library/generated: doc-support/result
ln -rfs ./doc-support/result/function-docs functions/library/generated
%.section.xml: %.section.md
$(PANDOC) $^ -t docbook \
$(pandoc_flags) \
-o $@
pandoc $^ -t docbook \
--extract-media=media \
--lua-filter=$(PANDOC_LUA_FILTERS_DIR)/diagram-generator.lua \
-f markdown+smart \
| cat > $@
%.chapter.xml: %.chapter.md
$(PANDOC) $^ -t docbook \
pandoc $^ -t docbook \
--top-level-division=chapter \
$(pandoc_flags) \
-o $@
--extract-media=media \
--lua-filter=$(PANDOC_LUA_FILTERS_DIR)/diagram-generator.lua \
-f markdown+smart \
| cat > $@

View File

@@ -1,23 +0,0 @@
--[[
Converts Code AST nodes produced by pandocs DocBook reader
from citerefentry elements into AST for corresponding role
for reStructuredText.
We use subset of MyST syntax (CommonMark with features from rST)
so lets use the rST AST for rST features.
Reference: https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-manpage
]]
function Code(elem)
elem.classes = elem.classes:map(function (x)
if x == 'citerefentry' then
elem.attributes['role'] = 'manpage'
return 'interpreted-text'
else
return x
end
end)
return elem
end

View File

@@ -1,34 +0,0 @@
--[[
Converts Link AST nodes with empty label to DocBook xref elements.
This is a temporary script to be able use cross-references conveniently
using syntax taken from MyST, while we still use docbook-xsl
for generating the documentation.
Reference: https://myst-parser.readthedocs.io/en/latest/using/syntax.html#targets-and-cross-referencing
]]
local function starts_with(start, str)
return str:sub(1, #start) == start
end
local function escape_xml_arg(arg)
amps = arg:gsub('&', '&amp;')
amps_quotes = amps:gsub('"', '&quot;')
amps_quotes_lt = amps_quotes:gsub('<', '&lt;')
return amps_quotes_lt
end
function Link(elem)
has_no_content = #elem.content == 0
targets_anchor = starts_with('#', elem.target)
has_no_attributes = elem.title == '' and elem.identifier == '' and #elem.classes == 0 and #elem.attributes == 0
if has_no_content and targets_anchor and has_no_attributes then
-- xref expects idref without the pound-sign
target_without_hash = elem.target:sub(2, #elem.target)
return pandoc.RawInline('docbook', '<xref linkend="' .. escape_xml_arg(target_without_hash) .. '" />')
end
end

View File

@@ -1,36 +0,0 @@
--[[
Converts AST for reStructuredText roles into corresponding
DocBook elements.
Currently, only a subset of roles is supported.
Reference:
List of roles:
https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html
manpage:
https://tdg.docbook.org/tdg/5.1/citerefentry.html
file:
https://tdg.docbook.org/tdg/5.1/filename.html
]]
function Code(elem)
if elem.classes:includes('interpreted-text') then
local tag = nil
local content = elem.text
if elem.attributes['role'] == 'manpage' then
tag = 'citerefentry'
local title, volnum = content:match('^(.+)%((%w+)%)$')
if title == nil then
-- No volnum in parentheses.
title = content
end
content = '<refentrytitle>' .. title .. '</refentrytitle>' .. (volnum ~= nil and ('<manvolnum>' .. volnum .. '</manvolnum>') or '')
elseif elem.attributes['role'] == 'file' then
tag = 'filename'
end
if tag ~= nil then
return pandoc.RawInline('docbook', '<' .. tag .. '>' .. content .. '</' .. tag .. '>')
end
end
end

View File

@@ -1,18 +0,0 @@
--[[
Turns a manpage reference into a link, when a mapping is defined
in the unix-man-urls.lua file.
]]
local man_urls = {
["tmpfiles.d(5)"] = "https://www.freedesktop.org/software/systemd/man/tmpfiles.d.html",
["nix.conf(5)"] = "https://nixos.org/manual/nix/stable/#sec-conf-file",
["systemd.time(7)"] = "https://www.freedesktop.org/software/systemd/man/systemd.time.html",
["systemd.timer(5)"] = "https://www.freedesktop.org/software/systemd/man/systemd.timer.html",
}
function Code(elem)
local is_man_role = elem.classes:includes('interpreted-text') and elem.attributes['role'] == 'manpage'
if is_man_role and man_urls[elem.text] ~= nil then
return pandoc.Link(elem, man_urls[elem.text])
end
end

View File

@@ -1,29 +0,0 @@
--[[
Replaces Str AST nodes containing {role}, followed by a Code node
by a Code node with attrs that would be produced by rST reader
from the role syntax.
This is to emulate MyST syntax in Pandoc.
(MyST is a CommonMark flavour with rST features mixed in.)
Reference: https://myst-parser.readthedocs.io/en/latest/syntax/syntax.html#roles-an-in-line-extension-point
]]
function Inlines(inlines)
for i = #inlines-1,1,-1 do
local first = inlines[i]
local second = inlines[i+1]
local correct_tags = first.tag == 'Str' and second.tag == 'Code'
if correct_tags then
-- docutils supports alphanumeric strings separated by [-._:]
-- We are slightly more liberal for simplicity.
local role = first.text:match('^{([-._+:%w]+)}$')
if role ~= nil then
inlines:remove(i)
second.attributes['role'] = role
second.classes:insert('interpreted-text')
end
end
end
return inlines
end

View File

@@ -1,25 +0,0 @@
--[[
Replaces Code nodes with attrs that would be produced by rST reader
from the role syntax by a Str AST node containing {role}, followed by a Code node.
This is to emulate MyST syntax in Pandoc.
(MyST is a CommonMark flavour with rST features mixed in.)
Reference: https://myst-parser.readthedocs.io/en/latest/syntax/syntax.html#roles-an-in-line-extension-point
]]
function Code(elem)
local role = elem.attributes['role']
if elem.classes:includes('interpreted-text') and role ~= nil then
elem.classes = elem.classes:filter(function (c)
return c ~= 'interpreted-text'
end)
elem.attributes['role'] = nil
return {
pandoc.Str('{' .. role .. '}'),
elem,
}
end
end

View File

@@ -1,16 +1,8 @@
# Fetchers {#chap-pkgs-fetchers}
When using Nix, you will frequently need to download source code and other files from the internet. For this purpose, Nix provides the [_fixed output derivation_](https://nixos.org/manual/nix/stable/#fixed-output-drvs) feature and Nixpkgs provides various functions that implement the actual fetching from various protocols and services.
When using Nix, you will frequently need to download source code and other files from the internet. Nixpkgs comes with a few helper functions that allow you to fetch fixed-output derivations in a structured way.
## Caveats
Because fixed output derivations are _identified_ by their hash, a common mistake is to update a fetcher's URL or a version parameter, without updating the hash. **This will cause the old contents to be used.** So remember to always invalidate the hash argument.
For those who develop and maintain fetchers, a similar problem arises with changes to the implementation of a fetcher. These may cause a fixed output derivation to fail, but won't normally be caught by tests because the supposed output is already in the store or cache. For the purpose of testing, you can use a trick that is embodied by the [`invalidateFetcherByDrvHash`](#sec-pkgs-invalidateFetcherByDrvHash) function. It uses the derivation `name` to create a unique output path per fetcher implementation, defeating the caching precisely where it would be harmful.
## `fetchurl` and `fetchzip` {#fetchurl}
Two basic fetchers are `fetchurl` and `fetchzip`. Both of these have two required arguments, a URL and a hash. The hash is typically `sha256`, although many more hash algorithms are supported. Nixpkgs contributors are currently recommended to use `sha256`. This hash will be used by Nix to identify your source. A typical usage of fetchurl is provided below.
The two fetcher primitives are `fetchurl` and `fetchzip`. Both of these have two required arguments, a URL and a hash. The hash is typically `sha256`, although many more hash algorithms are supported. Nixpkgs contributors are currently recommended to use `sha256`. This hash will be used by Nix to identify your source. A typical usage of fetchurl is provided below.
```nix
{ stdenv, fetchurl }:
@@ -28,58 +20,59 @@ The main difference between `fetchurl` and `fetchzip` is in how they store the c
`fetchpatch` works very similarly to `fetchurl` with the same arguments expected. It expects patch files as a source and performs normalization on them before computing the checksum. For example it will remove comments or other unstable parts that are sometimes added by version control systems and can change over time.
Most other fetchers return a directory rather than a single file.
## `fetchsvn` {#fetchsvn}
Other fetcher functions allow you to add source code directly from a VCS such as subversion or git. These are mostly straightforward nambes based on the name of the command used with the VCS system. Because they give you a working repository, they act most like `fetchzip`.
## `fetchsvn`
Used with Subversion. Expects `url` to a Subversion directory, `rev`, and `sha256`.
## `fetchgit` {#fetchgit}
## `fetchgit`
Used with Git. Expects `url` to a Git repo, `rev`, and `sha256`. `rev` in this case can be full the git commit id (SHA1 hash) or a tag name like `refs/tags/v1.0`.
Additionally the following optional arguments can be given: `fetchSubmodules = true` makes `fetchgit` also fetch the submodules of a repository. If `deepClone` is set to true, the entire repository is cloned as opposing to just creating a shallow clone. `deepClone = true` also implies `leaveDotGit = true` which means that the `.git` directory of the clone won't be removed after checkout.
## `fetchfossil` {#fetchfossil}
## `fetchfossil`
Used with Fossil. Expects `url` to a Fossil archive, `rev`, and `sha256`.
## `fetchcvs` {#fetchcvs}
## `fetchcvs`
Used with CVS. Expects `cvsRoot`, `tag`, and `sha256`.
## `fetchhg` {#fetchhg}
## `fetchhg`
Used with Mercurial. Expects `url`, `rev`, and `sha256`.
A number of fetcher functions wrap part of `fetchurl` and `fetchzip`. They are mainly convenience functions intended for commonly used destinations of source code in Nixpkgs. These wrapper fetchers are listed below.
## `fetchFromGitHub` {#fetchfromgithub}
## `fetchFromGitHub`
`fetchFromGitHub` expects four arguments. `owner` is a string corresponding to the GitHub user or organization that controls this repository. `repo` corresponds to the name of the software repository. These are located at the top of every GitHub HTML page as `owner`/`repo`. `rev` corresponds to the Git commit hash or tag (e.g `v1.0`) that will be downloaded from Git. Finally, `sha256` corresponds to the hash of the extracted directory. Again, other hash algorithms are also available but `sha256` is currently preferred.
`fetchFromGitHub` uses `fetchzip` to download the source archive generated by GitHub for the specified revision. If `leaveDotGit`, `deepClone` or `fetchSubmodules` are set to `true`, `fetchFromGitHub` will use `fetchgit` instead. Refer to its section for documentation of these options.
## `fetchFromGitLab` {#fetchfromgitlab}
## `fetchFromGitLab`
This is used with GitLab repositories. The arguments expected are very similar to fetchFromGitHub above.
## `fetchFromGitiles` {#fetchfromgitiles}
## `fetchFromGitiles`
This is used with Gitiles repositories. The arguments expected are similar to fetchgit.
## `fetchFromBitbucket` {#fetchfrombitbucket}
## `fetchFromBitbucket`
This is used with BitBucket repositories. The arguments expected are very similar to fetchFromGitHub above.
## `fetchFromSavannah` {#fetchfromsavannah}
## `fetchFromSavannah`
This is used with Savannah repositories. The arguments expected are very similar to fetchFromGitHub above.
## `fetchFromRepoOrCz` {#fetchfromrepoorcz}
## `fetchFromRepoOrCz`
This is used with repo.or.cz repositories. The arguments expected are very similar to fetchFromGitHub above.
## `fetchFromSourcehut` {#fetchfromsourcehut}
## `fetchFromSourcehut`
This is used with sourcehut repositories. The arguments expected are very similar to fetchFromGitHub above. Don't forget the tilde (~) in front of the user name!

View File

@@ -2,7 +2,7 @@
`pkgs.appimageTools` is a set of functions for extracting and wrapping [AppImage](https://appimage.org/) files. They are meant to be used if traditional packaging from source is infeasible, or it would take too long. To quickly run an AppImage file, `pkgs.appimage-run` can be used as well.
::: {.warning}
::: warning
The `appimageTools` API is unstable and may be subject to backwards-incompatible changes in the future.
:::

View File

@@ -1,6 +1,6 @@
# pkgs.dockerTools {#sec-pkgs-dockerTools}
`pkgs.dockerTools` is a set of functions for creating and manipulating Docker images according to the [Docker Image Specification v1.2.0](https://github.com/moby/moby/blob/master/image/spec/v1.2.md#docker-image-specification-v120). Docker itself is not used to perform any of the operations done by these functions.
`pkgs.dockerTools` is a set of functions for creating and manipulating Docker images according to the [ Docker Image Specification v1.2.0 ](https://github.com/moby/moby/blob/master/image/spec/v1.2.md#docker-image-specification-v120). Docker itself is not used to perform any of the operations done by these functions.
## buildImage {#ssec-pkgs-dockerTools-buildImage}
@@ -52,7 +52,7 @@ The above example will build a Docker image `redis/latest` from the given base i
> **_NOTE:_** Using this parameter requires the `kvm` device to be available.
- `config` is used to specify the configuration of the containers that will be started off the built image in Docker. The available options are listed in the [Docker Image Specification v1.2.0](https://github.com/moby/moby/blob/master/image/spec/v1.2.md#image-json-field-descriptions).
- `config` is used to specify the configuration of the containers that will be started off the built image in Docker. The available options are listed in the [ Docker Image Specification v1.2.0 ](https://github.com/moby/moby/blob/master/image/spec/v1.2.md#image-json-field-descriptions).
After the new layer has been created, its closure (to which `contents`, `config` and `runAsRoot` contribute) will be copied in the layer itself. Only new dependencies that are not already in the existing layers will be copied.

View File

@@ -14,7 +14,7 @@ Currently, `makeSnap` does not support creating GUI stubs.
The following expression packages GNU Hello as a Snapcraft snap.
``` {#ex-snapTools-buildSnap-hello .nix}
```{#ex-snapTools-buildSnap-hello .nix}
let
inherit (import <nixpkgs> { }) snapTools hello;
in snapTools.makeSnap {
@@ -35,7 +35,7 @@ in snapTools.makeSnap {
Graphical programs require many more integrations with the host. This example uses Firefox as an example, because it is one of the most complicated programs we could package.
``` {#ex-snapTools-buildSnap-firefox .nix}
```{#ex-snapTools-buildSnap-firefox .nix}
let
inherit (import <nixpkgs> { }) snapTools firefox;
in snapTools.makeSnap {

View File

@@ -1,6 +1,6 @@
# Cataclysm: Dark Days Ahead {#cataclysm-dark-days-ahead}
## How to install Cataclysm DDA {#how-to-install-cataclysm-dda}
## How to install Cataclysm DDA
To install the latest stable release of Cataclysm DDA to your profile, execute
`nix-env -f "<nixpkgs>" -iA cataclysm-dda`. For the curses build (build
@@ -34,7 +34,7 @@ cataclysm-dda.override {
}
```
## Important note for overriding packages {#important-note-for-overriding-packages}
## Important note for overriding packages
After applying `overrideAttrs`, you need to fix `passthru.pkgs` and
`passthru.withMods` attributes either manually or by using `attachPkgs`:
@@ -69,7 +69,7 @@ in
goodExample2.withMods (_: []) # parallel building enabled
```
## Customizing with mods {#customizing-with-mods}
## Customizing with mods
To install Cataclysm DDA with mods of your choice, you can use `withMods`
attribute:

View File

@@ -6,6 +6,6 @@ To start a development environment do
nix-shell -p elmPackages.elm elmPackages.elm-format
```
To update the Elm compiler, see `nixpkgs/pkgs/development/compilers/elm/README.md`.
To update the Elm compiler, see <filename>nixpkgs/pkgs/development/compilers/elm/README.md</filename>.
To package Elm applications, [read about elm2nix](https://github.com/hercules-ci/elm2nix#elm2nix).

View File

@@ -110,7 +110,7 @@ overrides = self: super: rec {
haskell-mode = self.melpaPackages.haskell-mode;
...
};
((emacsPackagesFor emacs).overrideScope' overrides).withPackages
((emacsPackagesFor emacs).overrideScope' overrides).emacs.pkgs.withPackages
(p: with p; [
# here both these package will use haskell-mode of our own choice
ghc-mod

View File

@@ -1,18 +0,0 @@
# /etc files {#etc}
Certain calls in glibc require access to runtime files found in /etc such as `/etc/protocols` or `/etc/services` -- [getprotobyname](https://linux.die.net/man/3/getprotobyname) is one such function.
On non-NixOS distributions these files are typically provided by packages (i.e. [netbase](https://packages.debian.org/sid/netbase)) if not already pre-installed in your distribution. This can cause non-reproducibility for code if they rely on these files being present.
If [iana-etc](https://hydra.nixos.org/job/nixos/trunk-combined/nixpkgs.iana-etc.x86_64-linux) is part of your _buildInputs_ then it will set the environment varaibles `NIX_ETC_PROTOCOLS` and `NIX_ETC_SERVICES` to the corresponding files in the package through a _setup-hook_.
```bash
> nix-shell -p iana-etc
[nix-shell:~]$ env | grep NIX_ETC
NIX_ETC_SERVICES=/nix/store/aj866hr8fad8flnggwdhrldm0g799ccz-iana-etc-20210225/etc/services
NIX_ETC_PROTOCOLS=/nix/store/aj866hr8fad8flnggwdhrldm0g799ccz-iana-etc-20210225/etc/protocols
```
Nixpkg's version of [glibc](https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/libraries/glibc/default.nix) has been patched to check for the existence of these environment variables. If the environment variable are *not set*, then it will attempt to find the files at the default location within _/etc_.

View File

@@ -1,13 +1,12 @@
# Firefox {#sec-firefox}
## Build wrapped Firefox with extensions and policies {#build-wrapped-firefox-with-extensions-and-policies}
## Build wrapped Firefox with extensions and policies
The `wrapFirefox` function allows to pass policies, preferences and extension that are available to Firefox. With the help of `fetchFirefoxAddon` this allows build a Firefox version that already comes with addons pre-installed:
The `wrapFirefox` function allows to pass policies, preferences and extension that are available to firefox. With the help of `fetchFirefoxAddon` this allows build a firefox version that already comes with addons pre-installed:
```nix
{
# Nix firefox addons only work with the firefox-esr package.
myFirefox = wrapFirefox firefox-esr-unwrapped {
myFirefox = wrapFirefox firefox-unwrapped {
nixExtensions = [
(fetchFirefoxAddon {
name = "ublock"; # Has to be unique!
@@ -46,7 +45,5 @@ or type into the Firefox url bar: `about:policies#documentation`.
Nix installed addons do not have a valid signature, which is why signature verification is disabled. This does not compromise security because downloaded addons are checksumed and manual addons can't be installed. Also make sure that the `name` field of fetchFirefoxAddon is unique. If you remove an addon from the nixExtensions array, rebuild and start Firefox the removed addon will be completly removed with all of its settings.
## Troubleshooting {#sec-firefox-troubleshooting}
If addons are marked as broken or the signature is invalid, make sure you have Firefox ESR installed. Normal Firefox does not provide the ability anymore to disable signature verification for addons thus nix addons get disabled by the normal Firefox binary.
If addons do not appear installed although they have been defined in your nix configuration file reset the local addon state of your Firefox profile by clicking `help -> restart with addons disabled -> restart -> refresh firefox`. This can happen if you switch from manual addon mode to nix addon mode and then back to manual mode and then again to nix addon mode.

View File

@@ -17,7 +17,6 @@
<xi:include href="kakoune.section.xml" />
<xi:include href="linux.section.xml" />
<xi:include href="locales.section.xml" />
<xi:include href="etc-files.section.xml" />
<xi:include href="nginx.section.xml" />
<xi:include href="opengl.section.xml" />
<xi:include href="shell-helpers.section.xml" />

View File

@@ -16,7 +16,7 @@ How to add a new (major) version of the Linux kernel to Nixpkgs:
1. Copy the old Nix expression (e.g. `linux-2.6.21.nix`) to the new one (e.g. `linux-2.6.22.nix`) and update it.
2. Add the new kernel to the `kernels` attribute set in `linux-kernels.nix` (e.g., create an attribute `kernel_2_6_22`).
2. Add the new kernel to `all-packages.nix` (e.g., create an attribute `kernel_2_6_22`).
3. Now were going to update the kernel configuration. First unpack the kernel. Then for each supported platform (`i686`, `x86_64`, `uml`) do the following:
@@ -36,6 +36,6 @@ How to add a new (major) version of the Linux kernel to Nixpkgs:
5. Copy `.config` over the new config file (e.g. `config-2.6.22-i686-smp`).
4. Test building the kernel: `nix-build -A linuxKernel.kernels.kernel_2_6_22`. If it compiles, ship it! For extra credit, try booting NixOS with it.
4. Test building the kernel: `nix-build -A kernel_2_6_22`. If it compiles, ship it! For extra credit, try booting NixOS with it.
5. It may be that the new kernel requires updating the external kernel modules and kernel-dependent packages listed in the `linuxPackagesFor` function in `linux-kernels.nix` (such as the NVIDIA drivers, AUFS, etc.). If the updated packages arent backwards compatible with older kernels, you may need to keep the older versions around.
5. It may be that the new kernel requires updating the external kernel modules and kernel-dependent packages listed in the `linuxPackagesFor` function in `all-packages.nix` (such as the NVIDIA drivers, AUFS, etc.). If the updated packages arent backwards compatible with older kernels, you may need to keep the older versions around.

View File

@@ -4,11 +4,11 @@ OpenGL support varies depending on which hardware is used and which drivers are
Broadly, we support both GL vendors: Mesa and NVIDIA.
## NixOS Desktop {#nixos-desktop}
## NixOS Desktop
The NixOS desktop or other non-headless configurations are the primary target for OpenGL libraries and applications. The current solution for discovering which drivers are available is based on [libglvnd](https://gitlab.freedesktop.org/glvnd/libglvnd). `libglvnd` performs "vendor-neutral dispatch", trying a variety of techniques to find the system's GL implementation. In practice, this will be either via standard GLX for X11 users or EGL for Wayland users, and supporting either NVIDIA or Mesa extensions.
## Nix on GNU/Linux {#nix-on-gnulinux}
## Nix on GNU/Linux
If you are using a non-NixOS GNU/Linux/X11 desktop with free software video drivers, consider launching OpenGL-dependent programs from Nixpkgs with Nixpkgs versions of `libglvnd` and `mesa.drivers` in `LD_LIBRARY_PATH`. For Mesa drivers, the Linux kernel version doesn't have to match nixpkgs.

View File

@@ -20,7 +20,6 @@ Use `programs.steam.enable = true;` if you want to add steam to systemPackages a
## Troubleshooting {#sec-steam-troub}
- **Steam fails to start. What do I do?**
Try to run
```ShellSession
@@ -33,30 +32,37 @@ Use `programs.steam.enable = true;` if you want to add steam to systemPackages a
- The `newStdcpp` parameter was removed since NixOS 17.09 and should not be needed anymore.
- Steam ships statically linked with a version of libcrypto that conflics with the one dynamically loaded by radeonsi_dri.so. If you get the error
```
steam.sh: line 713: 7842 Segmentation fault (core dumped)
```
have a look at [this pull request](https://github.com/NixOS/nixpkgs/pull/20269).
- **Java**
1. There is no java in steam chrootenv by default. If you get a message like
```
/home/foo/.local/share/Steam/SteamApps/common/towns/towns.sh: line 1: java: command not found
```
```
/home/foo/.local/share/Steam/SteamApps/common/towns/towns.sh: line 1: java: command not found
```
you need to add
You need to add
```nix
steam.override { withJava = true; };
```
```nix
steam.override { withJava = true; };
```
## steam-run {#sec-steam-run}
The FHS-compatible chroot used for Steam can also be used to run other Linux games that expect a FHS environment. To use it, install the `steam-run-native` package and run the game with
The FHS-compatible chroot used for steam can also be used to run other linux games that expect a FHS environment. To do it, add
```nix
pkgs.steam.override ({
nativeOnly = true;
newStdcpp = true;
}).run
```
to your configuration, rebuild, and run the game with
```
steam-run ./foo

View File

@@ -41,7 +41,7 @@ weechat.override {
configure = { availablePlugins, ... }: {
init = ''
/set foo bar
/server add libera irc.libera.chat
/server add freenode chat.freenode.org
'';
};
}

View File

@@ -2,7 +2,7 @@
The Nix expressions for the X.org packages reside in `pkgs/servers/x11/xorg/default.nix`. This file is automatically generated from lists of tarballs in an X.org release. As such it should not be modified directly; rather, you should modify the lists, the generator script or the file `pkgs/servers/x11/xorg/overrides.nix`, in which you can override or add to the derivations produced by the generator.
## Katamari Tarballs {#katamari-tarballs}
## Katamari Tarballs
X.org upstream releases used to include [katamari](https://en.wiktionary.org/wiki/%E3%81%8B%E3%81%9F%E3%81%BE%E3%82%8A) releases, which included a holistic recommended version for each tarball, up until 7.7. To create a list of tarballs in a katamari release:
@@ -14,11 +14,11 @@ cat $(PRINT_PATH=1 nix-prefetch-url $url | tail -n 1) \
| sort > "tarballs-$release.list"
```
## Individual Tarballs {#individual-tarballs}
## Individual Tarballs
The upstream release process for [X11R7.8](https://x.org/wiki/Releases/7.8/) does not include a planned katamari. Instead, each component of X.org is released as its own tarball. We maintain `pkgs/servers/x11/xorg/tarballs.list` as a list of tarballs for each individual package. This list includes X.org core libraries and protocol descriptions, extra newer X11 interface libraries, like `xorg.libxcb`, and classic utilities which are largely unused but still available if needed, like `xorg.imake`.
## Generating Nix Expressions {#generating-nix-expressions}
## Generating Nix Expressions
The generator is invoked as follows:
@@ -29,6 +29,6 @@ cd pkgs/servers/x11/xorg
For each of the tarballs in the `.list` files, the script downloads it, unpacks it, and searches its `configure.ac` and `*.pc.in` files for dependencies. This information is used to generate `default.nix`. The generator caches downloaded tarballs between runs. Pay close attention to the `NOT FOUND: $NAME` messages at the end of the run, since they may indicate missing dependencies. (Some might be optional dependencies, however.)
## Overriding the Generator {#overriding-the-generator}
## Overriding the Generator
If the expression for a package requires derivation attributes that the generator cannot figure out automatically (say, `patches` or a `postInstall` hook), you should modify `pkgs/servers/x11/xorg/overrides.nix`.

View File

@@ -7,5 +7,4 @@
</para>
<xi:include href="special/fhs-environments.section.xml" />
<xi:include href="special/mkshell.section.xml" />
<xi:include href="special/invalidateFetcherByDrvHash.section.xml" />
</chapter>

View File

@@ -18,8 +18,6 @@
Additional commands to be executed for finalizing the derivation with runner script.
- `runScript`
A command that would be executed inside the sandbox and passed all the command line arguments. It defaults to `bash`.
- `profile`
Optional script for `/etc/profile` within the sandbox.
One can create a simple environment using a `shell.nix` like that:
@@ -30,7 +28,7 @@ One can create a simple environment using a `shell.nix` like that:
name = "simple-x11-env";
targetPkgs = pkgs: (with pkgs;
[ udev
alsa-lib
alsaLib
]) ++ (with pkgs.xorg;
[ libX11
libXcursor
@@ -38,7 +36,7 @@ One can create a simple environment using a `shell.nix` like that:
]);
multiPkgs = pkgs: (with pkgs;
[ udev
alsa-lib
alsaLib
]);
runScript = "bash";
}).env

View File

@@ -1,31 +0,0 @@
## `invalidateFetcherByDrvHash` {#sec-pkgs-invalidateFetcherByDrvHash}
Use the derivation hash to invalidate the output via name, for testing.
Type: `(a@{ name, ... } -> Derivation) -> a -> Derivation`
Normally, fixed output derivations can and should be cached by their output
hash only, but for testing we want to re-fetch everytime the fetcher changes.
Changes to the fetcher become apparent in the drvPath, which is a hash of
how to fetch, rather than a fixed store path.
By inserting this hash into the name, we can make sure to re-run the fetcher
every time the fetcher changes.
This relies on the assumption that Nix isn't clever enough to reuse its
database of local store contents to optimize fetching.
You might notice that the "salted" name derives from the normal invocation,
not the final derivation. `invalidateFetcherByDrvHash` has to invoke the fetcher
function twice: once to get a derivation hash, and again to produce the final
fixed output derivation.
Example:
tests.fetchgit = invalidateFetcherByDrvHash fetchgit {
name = "nix-source";
url = "https://github.com/NixOS/nix";
rev = "9d9dbe6ed05854e03811c361a3380e09183f4f4a";
sha256 = "sha256-7DszvbCNTjpzGRmpIVAWXk20P0/XTrWZ79KSOGLrUWY=";
};

View File

@@ -37,7 +37,7 @@ This works just like `runCommand`. The only difference is that it also provides
Variant of `runCommand` that forces the derivation to be built locally, it is not substituted. This is intended for very cheap commands (<1s execution time). It saves on the network roundrip and can speed up a build.
::: {.note}
::: note
This sets [`allowSubstitutes` to `false`](https://nixos.org/nix/manual/#adv-attr-allowSubstitutes), so only use `runCommandLocal` if you are certain the user will always have a builder for the `system` of the derivation. This should be true for most trivial use cases (e.g. just copying some files to a different location or adding symlinks), because there the `system` is usually the same as `builtins.currentSystem`.
:::
@@ -47,28 +47,6 @@ These functions write `text` to the Nix store. This is useful for creating scrip
Many more commands wrap `writeTextFile` including `writeText`, `writeTextDir`, `writeScript`, and `writeScriptBin`. These are convenience functions over `writeTextFile`.
## `writeShellApplication` {#trivial-builder-writeShellApplication}
This can be used to easily produce a shell script that has some dependencies (`runtimeInputs`). It automatically sets the `PATH` of the script to contain all of the listed inputs, sets some sanity shellopts (`errexit`, `nounset`, `pipefail`), and checks the resulting script with [`shellcheck`](https://github.com/koalaman/shellcheck).
For example, look at the following code:
```nix
writeShellApplication {
name = "show-nixos-org";
runtimeInputs = [ curl w3m ];
text = ''
curl -s 'https://nixos.org' | w3m -dump -T text/html
'';
}
```
Unlike with normal `writeShellScriptBin`, there is no need to manually write out `${curl}/bin/curl`, setting the PATH
was handled by `writeShellApplication`. Moreover, the script is being checked with `shellcheck` for more strict
validation.
## `symlinkJoin` {#trivial-builder-symlinkJoin}
This can be used to put many derivations into the same directory structure. It works by creating a new derivation and adding symlinks to each of the paths listed. It expects two arguments, `name`, and `paths`. `name` is the name used in the Nix store path for the created derivation. `paths` is a list of paths that will be symlinked. These paths can be to Nix store derivations or any other subdirectory contained within.

View File

@@ -6,7 +6,7 @@
- Do not use tab characters, i.e. configure your editor to use soft tabs. For instance, use `(setq-default indent-tabs-mode nil)` in Emacs. Everybody has different tab settings so its asking for trouble.
- Use `lowerCamelCase` for variable names, not `UpperCamelCase`. Note, this rule does not apply to package attribute names, which instead follow the rules in [](#sec-package-naming).
- Use `lowerCamelCase` for variable names, not `UpperCamelCase`. Note, this rule does not apply to package attribute names, which instead follow the rules in <xref linkend="sec-package-naming"/>.
- Function calls with attribute set arguments are written as
@@ -181,23 +181,11 @@
rev = "${version}";
```
- Building lists conditionally _should_ be done with `lib.optional(s)` instead of using `if cond then [ ... ] else null` or `if cond then [ ... ] else [ ]`.
```nix
buildInputs = lib.optional stdenv.isDarwin iconv;
```
instead of
```nix
buildInputs = if stdenv.isDarwin then [ iconv ] else null;
```
As an exception, an explicit conditional expression with null can be used when fixing a important bug without triggering a mass rebuild.
If this is done a follow up pull request _should_ be created to change the code to `lib.optional(s)`.
- Arguments should be listed in the order they are used, with the exception of `lib`, which always goes first.
- The top-level `lib` must be used in the master and 21.05 branch over its alias `stdenv.lib` as it now causes evaluation errors when aliases are disabled which is the case for ofborg.
`lib` is unrelated to `stdenv`, and so `stdenv.lib` should only be used as a convenience alias when developing locally to avoid having to modify the function inputs just to test something out.
## Package naming {#sec-package-naming}
The key words _must_, _must not_, _required_, _shall_, _shall not_, _should_, _should not_, _recommended_, _may_, and _optional_ in this section are to be interpreted as described in [RFC 2119](https://tools.ietf.org/html/rfc2119). Only _emphasized_ words are to be interpreted in this way.
@@ -224,7 +212,7 @@ There are a few naming guidelines:
- Dashes in the package name _should_ be preserved in new variable names, rather than converted to underscores or camel cased — e.g., `http-parser` instead of `http_parser` or `httpParser`. The hyphenated style is preferred in all three package names.
- If there are multiple versions of a package, this _should_ be reflected in the variable names in `all-packages.nix`, e.g. `json-c-0-9` and `json-c-0-11`. If there is an obvious “default” version, make an attribute like `json-c = json-c-0-9;`. See also [](#sec-versioning)
- If there are multiple versions of a package, this _should_ be reflected in the variable names in `all-packages.nix`, e.g. `json-c-0-9` and `json-c-0-11`. If there is an obvious “default” version, make an attribute like `json-c = json-c-0-9;`. See also <xref linkend="sec-versioning" />
## File naming and organisation {#sec-organisation}
@@ -477,9 +465,9 @@ Preferred source hash type is sha256. There are several ways to get it.
For package updates it is enough to change one symbol to make hash fake. For new packages, you can use `lib.fakeSha256`, `lib.fakeSha512` or any other fake hash.
This is last resort method when reconstructing source URL is non-trivial and `nix-prefetch-url -A` isnt applicable (for example, [one of `kodi` dependencies](https://github.com/NixOS/nixpkgs/blob/d2ab091dd308b99e4912b805a5eb088dd536adb9/pkgs/applications/video/kodi/default.nix#L73)). The easiest way then would be replace hash with a fake one and rebuild. Nix build will fail and error message will contain desired hash.
This is last resort method when reconstructing source URL is non-trivial and `nix-prefetch-url -A` isn't applicable (for example, [one of `kodi` dependencies](https://github.com/NixOS/nixpkgs/blob/d2ab091dd308b99e4912b805a5eb088dd536adb9/pkgs/applications/video/kodi/default.nix#L73")). The easiest way then would be replace hash with a fake one and rebuild. Nix build will fail and error message will contain desired hash.
::: {.warning}
::: warning
This method has security problems. Check below for details.
:::
@@ -535,7 +523,7 @@ If you do need to do create this sort of patch file, one way to do so is with gi
4. Use git to create a diff, and pipe the output to a patch file:
```ShellSession
$ git diff -a > nixpkgs/pkgs/the/package/0001-changes.patch
$ git diff > nixpkgs/pkgs/the/package/0001-changes.patch
```
If a patch is available online but does not cleanly apply, it can be modified in some fixed ways by using additional optional arguments for `fetchpatch`:
@@ -552,34 +540,9 @@ Note that because the checksum is computed after applying these effects, using o
Tests are important to ensure quality and make reviews and automatic updates easy.
The following types of tests exists:
Nix package tests are a lightweight alternative to [NixOS module tests](https://nixos.org/manual/nixos/stable/#sec-nixos-tests). They can be used to create simple integration tests for packages while the module tests are used to test services or programs with a graphical user interface on a NixOS VM. Unittests that are included in the source code of a package should be executed in the `checkPhase`.
* [NixOS **module tests**](https://nixos.org/manual/nixos/stable/#sec-nixos-tests), which spawn one or more NixOS VMs. They exercise both NixOS modules and the packaged programs used within them. For example, a NixOS module test can start a web server VM running the `nginx` module, and a client VM running `curl` or a graphical `firefox`, and test that they can talk to each other and display the correct content.
* Nix **package tests** are a lightweight alternative to NixOS module tests. They should be used to create simple integration tests for packages, but cannot test NixOS services, and some programs with graphical user interfaces may also be difficult to test with them.
* The **`checkPhase` of a package**, which should execute the unit tests that are included in the source code of a package.
Here in the nixpkgs manual we describe mostly _package tests_; for _module tests_ head over to the corresponding [section in the NixOS manual](https://nixos.org/manual/nixos/stable/#sec-nixos-tests).
### Writing inline package tests {#ssec-inline-package-tests-writing}
For very simple tests, they can be written inline:
```nix
{ …, yq-go }:
buildGoModule rec {
passthru.tests = {
simple = runCommand "${pname}-test" {} ''
echo "test: 1" | ${yq-go}/bin/yq eval -j > $out
[ "$(cat $out | tr -d $'\n ')" = '{"test":1}' ]
'';
};
}
```
### Writing larger package tests {#ssec-package-tests-writing}
### Writing package tests {#ssec-package-tests-writing}
This is an example using the `phoronix-test-suite` package with the current best practices.
@@ -608,7 +571,7 @@ let
inherit (phoronix-test-suite) pname version;
in
runCommand "${pname}-tests" { meta.timeout = 60; }
runCommand "${pname}-tests" { meta.timeout = 3; }
''
# automatic initial setup to prevent interactive questions
${phoronix-test-suite}/bin/phoronix-test-suite enterprise-setup >/dev/null
@@ -642,23 +605,3 @@ Here are examples of package tests:
- [Spacy annotation test](https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/python-modules/spacy/annotation-test/default.nix)
- [Libtorch test](https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/libraries/science/math/libtorch/test/default.nix)
- [Multiple tests for nanopb](https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/libraries/nanopb/default.nix)
### Linking NixOS module tests to a package {#ssec-nixos-tests-linking}
Like [package tests](#ssec-package-tests-writing) as shown above, [NixOS module tests](https://nixos.org/manual/nixos/stable/#sec-nixos-tests) can also be linked to a package, so that the tests can be easily run when changing the related package.
For example, assuming we're packaging `nginx`, we can link its module test via `passthru.tests`:
```nix
{ stdenv, lib, nixosTests }:
stdenv.mkDerivation {
...
passthru.tests = {
nginx = nixosTests.nginx;
};
...
}
```

View File

@@ -1,13 +1,13 @@
# Contributing to this documentation {#chap-contributing}
The sources of the Nixpkgs manual are in the [doc](https://github.com/NixOS/nixpkgs/tree/master/doc) subdirectory of the Nixpkgs repository. The manual is still partially written in DocBook but it is progressively being converted to [Markdown](#sec-contributing-markup).
The DocBook sources of the Nixpkgs manual are in the [doc](https://github.com/NixOS/nixpkgs/tree/master/doc) subdirectory of the Nixpkgs repository.
You can quickly check your edits with `make`:
```ShellSession
$ cd /path/to/nixpkgs/doc
$ nix-shell
[nix-shell]$ make
[nix-shell]$ make $makeFlags
```
If you experience problems, run `make debug` to help understand the docbook errors.
@@ -22,85 +22,3 @@ $ nix-shell
```
If the build succeeds, the manual will be in `./result/share/doc/nixpkgs/manual.html`.
## Syntax {#sec-contributing-markup}
As per [RFC 0072](https://github.com/NixOS/rfcs/pull/72), all new documentation content should be written in [CommonMark](https://commonmark.org/) Markdown dialect.
Additionally, the following syntax extensions are currently used:
- []{#ssec-contributing-markup-anchors}
Explicitly defined **anchors** on headings, to allow linking to sections. These should be always used, to ensure the anchors can be linked even when the heading text changes, and to prevent conflicts between [automatically assigned identifiers](https://github.com/jgm/commonmark-hs/blob/master/commonmark-extensions/test/auto_identifiers.md).
It uses the widely compatible [header attributes](https://github.com/jgm/commonmark-hs/blob/master/commonmark-extensions/test/attributes.md) syntax:
```markdown
## Syntax {#sec-contributing-markup}
```
- []{#ssec-contributing-markup-anchors-inline}
**Inline anchors**, which allow linking arbitrary place in the text (e.g. individual list items, sentences…).
They are defined using a hybrid of the link syntax with the attributes syntax known from headings, called [bracketed spans](https://github.com/jgm/commonmark-hs/blob/master/commonmark-extensions/test/bracketed_spans.md):
```markdown
- []{#ssec-gnome-hooks-glib} `glib` setup hook will populate `GSETTINGS_SCHEMAS_PATH` and then `wrapGAppsHook` will prepend it to `XDG_DATA_DIRS`.
```
- []{#ssec-contributing-markup-automatic-links}
If you **omit a link text** for a link pointing to a section, the text will be substituted automatically. For example, `[](#chap-contributing)` will result in [](#chap-contributing).
This syntax is taken from [MyST](https://myst-parser.readthedocs.io/en/latest/using/syntax.html#targets-and-cross-referencing).
- []{#ssec-contributing-markup-inline-roles}
If you want to link to a man page, you can use `` {manpage}`nix.conf(5)` ``, which will turn into {manpage}`nix.conf(5)`.
The references will turn into links when a mapping exists in {file}`doc/build-aux/pandoc-filters/unix-man-urls.lua`.
This syntax is taken from [MyST](https://myst-parser.readthedocs.io/en/latest/syntax/syntax.html#roles-an-in-line-extension-point). Though, the feature originates from [reStructuredText](https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-manpage) with slightly different syntax.
- []{#ssec-contributing-markup-admonitions}
**Admonitions**, set off from the text to bring attention to something.
It uses pandocs [fenced `div`s syntax](https://github.com/jgm/commonmark-hs/blob/master/commonmark-extensions/test/fenced_divs.md):
```markdown
::: {.warning}
This is a warning
:::
```
which renders as
> ::: {.warning}
> This is a warning.
> :::
The following are supported:
- [`caution`](https://tdg.docbook.org/tdg/5.0/caution.html)
- [`important`](https://tdg.docbook.org/tdg/5.0/important.html)
- [`note`](https://tdg.docbook.org/tdg/5.0/note.html)
- [`tip`](https://tdg.docbook.org/tdg/5.0/tip.html)
- [`warning`](https://tdg.docbook.org/tdg/5.0/warning.html)
- []{#ssec-contributing-markup-definition-lists}
[**Definition lists**](https://github.com/jgm/commonmark-hs/blob/master/commonmark-extensions/test/definition_lists.md), for defining a group of terms:
```markdown
pear
: green or yellow bulbous fruit
watermelon
: green fruit with red flesh
```
which renders as
> pear
> : green or yellow bulbous fruit
>
> watermelon
> : green fruit with red flesh
For contributing to the legacy parts, please see [DocBook: The Definitive Guide](https://tdg.docbook.org/) or the [DocBook rocks! primer](https://web.archive.org/web/20200816233747/https://docbook.rocks/).

View File

@@ -9,7 +9,7 @@ To add a package to Nixpkgs:
$ cd nixpkgs
```
2. Find a good place in the Nixpkgs tree to add the Nix expression for your package. For instance, a library package typically goes into `pkgs/development/libraries/pkgname`, while a web browser goes into `pkgs/applications/networking/browsers/pkgname`. See [](#sec-organisation) for some hints on the tree organisation. Create a directory for your package, e.g.
2. Find a good place in the Nixpkgs tree to add the Nix expression for your package. For instance, a library package typically goes into `pkgs/development/libraries/pkgname`, while a web browser goes into `pkgs/applications/networking/browsers/pkgname`. See <xref linkend="sec-organisation" /> for some hints on the tree organisation. Create a directory for your package, e.g.
```ShellSession
$ mkdir pkgs/development/libraries/libfoo

View File

@@ -1,6 +1,6 @@
# Reviewing contributions {#chap-reviewing-contributions}
::: {.warning}
::: warning
The following section is a draft, and the policy for reviewing is still being discussed in issues such as [#11166](https://github.com/NixOS/nixpkgs/issues/11166) and [#20836](https://github.com/NixOS/nixpkgs/issues/20836).
:::
@@ -35,18 +35,15 @@ Reviewing process:
- Building the package locally.
- pull requests are often targeted to the master or staging branch, and building the pull request locally when it is submitted can trigger many source builds.
- It is possible to rebase the changes on nixos-unstable or nixpkgs-unstable for easier review by running the following commands from a nixpkgs clone.
```ShellSession
$ git fetch origin nixos-unstable
$ git fetch origin pull/PRNUMBER/head
$ git rebase --onto nixos-unstable BASEBRANCH FETCH_HEAD
```
- The first command fetches the nixos-unstable branch.
- The second command fetches the pull request changes, `PRNUMBER` is the number at the end of the pull request title and `BASEBRANCH` the base branch of the pull request.
- The third command rebases the pull request changes to the nixos-unstable branch.
- The [nixpkgs-review](https://github.com/Mic92/nixpkgs-review) tool can be used to review a pull request content in a single command. `PRNUMBER` should be replaced by the number at the end of the pull request title. You can also provide the full github pull request url.
```ShellSession
$ nix-shell -p nixpkgs-review --run "nixpkgs-review pr PRNUMBER"
```

View File

@@ -62,7 +62,7 @@
- Push your changes to your fork of nixpkgs.
- Create the pull request
- Follow [the contribution guidelines](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md#submitting-changes).
- Follow [the contribution guidelines](https://github.com/NixOS/nixpkgs/blob/master/.github/CONTRIBUTING.md#submitting-changes).
## Submitting security fixes {#submitting-changes-submitting-security-fixes}
@@ -71,7 +71,6 @@ Security fixes are submitted in the same way as other changes and thus the same
- If a new version fixing the vulnerability has been released, update the package;
- If the security fix comes in the form of a patch and a CVE is available, then add the patch to the Nixpkgs tree, and apply it to the package.
The name of the patch should be the CVE identifier, so e.g. `CVE-2019-13636.patch`; If a patch is fetched the name needs to be set as well, e.g.:
```nix
(fetchpatch {
name = "CVE-2019-11068.patch";
@@ -90,7 +89,7 @@ There is currently no policy when to remove a package.
Before removing a package, one should try to find a new maintainer or fix smaller issues first.
### Steps to remove a package from Nixpkgs {#steps-to-remove-a-package-from-nixpkgs}
### Steps to remove a package from Nixpkgs
We use jbidwatcher as an example for a discontinued project here.
@@ -101,7 +100,6 @@ We use jbidwatcher as an example for a discontinued project here.
1. Add an alias for the package name in `pkgs/top-level/aliases.nix` (There is also `pkgs/misc/vim-plugins/aliases.nix`. Package sets typically do not have aliases, so we can't add them there.)
For example in this case:
```
jbidwatcher = throw "jbidwatcher was discontinued in march 2021"; # added 2021-03-15
```
@@ -193,7 +191,7 @@ Its important to test any executables generated by a build when you change or
### Meets Nixpkgs contribution standards {#submitting-changes-contribution-standards}
The last checkbox is fits [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/CONTRIBUTING.md). The contributing document has detailed information on standards the Nix community has for commit messages, reviews, licensing of contributions you make to the project, etc\... Everyone should read and understand the standards the community has for contributing before submitting a pull request.
The last checkbox is fits [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/.github/CONTRIBUTING.md). The contributing document has detailed information on standards the Nix community has for commit messages, reviews, licensing of contributions you make to the project, etc\... Everyone should read and understand the standards the community has for contributing before submitting a pull request.
## Hotfixing pull requests {#submitting-changes-hotfixing-pull-requests}
@@ -240,7 +238,7 @@ The `staging` branch is a development branch where mass-rebuilds go. It should o
### Staging-next branch {#submitting-changes-staging-next-branch}
The `staging-next` branch is for stabilizing mass-rebuilds submitted to the `staging` branch prior to merging them into `master`. Mass-rebuilds must go via the `staging` branch. It must only see non-breaking commits that are fixing issues blocking it from being merged into the `master ` branch.
The `staging-next` branch is for stabilizing mass-rebuilds submitted to the `staging` branch prior to merging them into `master`. Mass-rebuilds should go via the `staging` branch. It should only see non-breaking commits that are fixing issues blocking it from being merged into the `master ` branch.
If the branch is already in a broken state, please refrain from adding extra new breakages. Stabilize it for a few days and then merge into master.
@@ -250,8 +248,6 @@ For cherry-picking a commit to a stable release branch (“backporting”), use
Add a reason for the backport by using `git cherry-pick -xe <original commit>` instead when it is not obvious from the original commit message. It is not needed when it's a minor version update that includes security and bug fixes but don't add new features or when the commit fixes an otherwise broken package.
For backporting Pull Requests to stable branches, assign label `backport <branch>` to the original Pull Requests and automation should take care of the rest once the Pull Requests is merged.
Here is an example of a cherry-picked commit message with good reason description:
```
@@ -269,14 +265,3 @@ Other examples of reasons are:
- Previously the build would fail due to, e.g., `getaddrinfo` not being defined
- The previous download links were all broken
- Crash when starting on some X11 systems
#### Acceptable backport criteria
The stable branch does have some changes which cannot be backported. Most notable are breaking changes. The desire is to have stable users be uninterrupted when updating packages.
However, many changes are able to be backported, including:
- New Packages / Modules
- Security / Patch updates
- Version updates which include new functionality (but no breaking changes)
- Services which require a client to be up-to-date regardless. (E.g. `spotify`, `steam`, or `discord`)
- Security critical applications (E.g. `firefox`)

View File

@@ -17,6 +17,10 @@ in pkgs.stdenv.mkDerivation {
src = lib.cleanSource ./.;
makeFlags = [
"PANDOC_LUA_FILTERS_DIR=${pkgs.pandoc-lua-filters}/share/pandoc/filters"
];
postPatch = ''
ln -s ${doc-support} ./doc-support/result
'';
@@ -33,7 +37,4 @@ in pkgs.stdenv.mkDerivation {
echo "doc manual $dest manual.html" >> $out/nix-support/hydra-build-products
echo "doc manual $dest nixpkgs-manual.epub" >> $out/nix-support/hydra-build-products
'';
# Environment variables
PANDOC_LUA_FILTERS_DIR = "${pkgs.pandoc-lua-filters}/share/pandoc/filters";
}

View File

@@ -22,6 +22,5 @@ with pkgs; stdenv.mkDerivation {
docgen lists 'List manipulation functions'
docgen debug 'Debugging functions'
docgen options 'NixOS / nixpkgs option handling'
docgen sources 'Source filtering functions'
'';
}

View File

@@ -7,8 +7,8 @@
The nixpkgs repository has several utility functions to manipulate Nix expressions.
</para>
<xi:include href="functions/library.xml" />
<xi:include href="functions/generators.section.xml" />
<xi:include href="functions/debug.section.xml" />
<xi:include href="functions/prefer-remote-fetch.section.xml" />
<xi:include href="functions/nix-gitignore.section.xml" />
<xi:include href="functions/generators.xml" />
<xi:include href="functions/debug.xml" />
<xi:include href="functions/prefer-remote-fetch.xml" />
<xi:include href="functions/nix-gitignore.xml" />
</chapter>

View File

@@ -1,5 +0,0 @@
# Debugging Nix Expressions {#sec-debug}
Nix is a unityped, dynamic language, this means every value can potentially appear anywhere. Since it is also non-strict, evaluation order and what ultimately is evaluated might surprise you. Therefore it is important to be able to debug nix expressions.
In the `lib/debug.nix` file you will find a number of functions that help (pretty-)printing values while evaluation is running. You can even specify how deep these values should be printed recursively, and transform them on the fly. Please consult the docstrings in `lib/debug.nix` for usage information.

14
doc/functions/debug.xml Normal file
View File

@@ -0,0 +1,14 @@
<section xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
xml:id="sec-debug">
<title>Debugging Nix Expressions</title>
<para>
Nix is a unityped, dynamic language, this means every value can potentially appear anywhere. Since it is also non-strict, evaluation order and what ultimately is evaluated might surprise you. Therefore it is important to be able to debug nix expressions.
</para>
<para>
In the <literal>lib/debug.nix</literal> file you will find a number of functions that help (pretty-)printing values while evaluation is runnnig. You can even specify how deep these values should be printed recursively, and transform them on the fly. Please consult the docstrings in <literal>lib/debug.nix</literal> for usage information.
</para>
</section>

View File

@@ -1,56 +0,0 @@
# Generators {#sec-generators}
Generators are functions that create file formats from nix data structures, e.g. for configuration files. There are generators available for: `INI`, `JSON` and `YAML`
All generators follow a similar call interface: `generatorName configFunctions data`, where `configFunctions` is an attrset of user-defined functions that format nested parts of the content. They each have common defaults, so often they do not need to be set manually. An example is `mkSectionName ? (name: libStr.escape [ "[" "]" ] name)` from the `INI` generator. It receives the name of a section and sanitizes it. The default `mkSectionName` escapes `[` and `]` with a backslash.
Generators can be fine-tuned to produce exactly the file format required by your application/service. One example is an INI-file format which uses `: ` as separator, the strings `"yes"`/`"no"` as boolean values and requires all string values to be quoted:
```nix
with lib;
let
customToINI = generators.toINI {
# specifies how to format a key/value pair
mkKeyValue = generators.mkKeyValueDefault {
# specifies the generated string for a subset of nix values
mkValueString = v:
if v == true then ''"yes"''
else if v == false then ''"no"''
else if isString v then ''"${v}"''
# and delegats all other values to the default generator
else generators.mkValueStringDefault {} v;
} ":";
};
# the INI file can now be given as plain old nix values
in customToINI {
main = {
pushinfo = true;
autopush = false;
host = "localhost";
port = 42;
};
mergetool = {
merge = "diff3";
};
}
```
This will produce the following INI file as nix string:
```INI
[main]
autopush:"no"
host:"localhost"
port:42
pushinfo:"yes"
str\:ange:"very::strange"
[mergetool]
merge:"diff3"
```
::: {.note}
Nix store paths can be converted to strings by enclosing a derivation attribute like so: `"${drv}"`.
:::
Detailed documentation for each generator can be found in `lib/generators.nix`.

View File

@@ -0,0 +1,74 @@
<section xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
xml:id="sec-generators">
<title>Generators</title>
<para>
Generators are functions that create file formats from nix data structures, e.g. for configuration files. There are generators available for: <literal>INI</literal>, <literal>JSON</literal> and <literal>YAML</literal>
</para>
<para>
All generators follow a similar call interface: <code>generatorName configFunctions data</code>, where <literal>configFunctions</literal> is an attrset of user-defined functions that format nested parts of the content. They each have common defaults, so often they do not need to be set manually. An example is <code>mkSectionName ? (name: libStr.escape [ "[" "]" ] name)</code> from the <literal>INI</literal> generator. It receives the name of a section and sanitizes it. The default <literal>mkSectionName</literal> escapes <literal>[</literal> and <literal>]</literal> with a backslash.
</para>
<para>
Generators can be fine-tuned to produce exactly the file format required by your application/service. One example is an INI-file format which uses <literal>: </literal> as separator, the strings <literal>"yes"</literal>/<literal>"no"</literal> as boolean values and requires all string values to be quoted:
</para>
<programlisting>
with lib;
let
customToINI = generators.toINI {
# specifies how to format a key/value pair
mkKeyValue = generators.mkKeyValueDefault {
# specifies the generated string for a subset of nix values
mkValueString = v:
if v == true then ''"yes"''
else if v == false then ''"no"''
else if isString v then ''"${v}"''
# and delegats all other values to the default generator
else generators.mkValueStringDefault {} v;
} ":";
};
# the INI file can now be given as plain old nix values
in customToINI {
main = {
pushinfo = true;
autopush = false;
host = "localhost";
port = 42;
};
mergetool = {
merge = "diff3";
};
}
</programlisting>
<para>
This will produce the following INI file as nix string:
</para>
<programlisting>
[main]
autopush:"no"
host:"localhost"
port:42
pushinfo:"yes"
str\:ange:"very::strange"
[mergetool]
merge:"diff3"
</programlisting>
<note>
<para>
Nix store paths can be converted to strings by enclosing a derivation attribute like so: <code>"${drv}"</code>.
</para>
</note>
<para>
Detailed documentation for each generator can be found in <literal>lib/generators.nix</literal>.
</para>
</section>

View File

@@ -25,6 +25,4 @@
<xi:include href="./library/generated/debug.xml" />
<xi:include href="./library/generated/options.xml" />
<xi:include href="./library/generated/sources.xml" />
</section>

View File

@@ -772,7 +772,7 @@ nameValuePair "some" 6
<title>Modifying each value of an attribute set</title>
<programlisting><![CDATA[
lib.attrsets.mapAttrs
(name: value: name + "-" + value)
(name: value: name + "-" value)
{ x = "foo"; y = "bar"; }
=> { x = "x-foo"; y = "y-bar"; }
]]></programlisting>

View File

@@ -1,49 +0,0 @@
# pkgs.nix-gitignore {#sec-pkgs-nix-gitignore}
`pkgs.nix-gitignore` is a function that acts similarly to `builtins.filterSource` but also allows filtering with the help of the gitignore format.
## Usage {#sec-pkgs-nix-gitignore-usage}
`pkgs.nix-gitignore` exports a number of functions, but you\'ll most likely need either `gitignoreSource` or `gitignoreSourcePure`. As their first argument, they both accept either 1. a file with gitignore lines or 2. a string with gitignore lines, or 3. a list of either of the two. They will be concatenated into a single big string.
```nix
{ pkgs ? import <nixpkgs> {} }:
nix-gitignore.gitignoreSource [] ./source
# Simplest version
nix-gitignore.gitignoreSource "supplemental-ignores\n" ./source
# This one reads the ./source/.gitignore and concats the auxiliary ignores
nix-gitignore.gitignoreSourcePure "ignore-this\nignore-that\n" ./source
# Use this string as gitignore, don't read ./source/.gitignore.
nix-gitignore.gitignoreSourcePure ["ignore-this\nignore-that\n", ~/.gitignore] ./source
# It also accepts a list (of strings and paths) that will be concatenated
# once the paths are turned to strings via readFile.
```
These functions are derived from the `Filter` functions by setting the first filter argument to `(_: _: true)`:
```nix
gitignoreSourcePure = gitignoreFilterSourcePure (_: _: true);
gitignoreSource = gitignoreFilterSource (_: _: true);
```
Those filter functions accept the same arguments the `builtins.filterSource` function would pass to its filters, thus `fn: gitignoreFilterSourcePure fn ""` should be extensionally equivalent to `filterSource`. The file is blacklisted if it\'s blacklisted by either your filter or the gitignoreFilter.
If you want to make your own filter from scratch, you may use
```nix
gitignoreFilter = ign: root: filterPattern (gitignoreToPatterns ign) root;
```
## gitignore files in subdirectories {#sec-pkgs-nix-gitignore-usage-recursive}
If you wish to use a filter that would search for .gitignore files in subdirectories, just like git does by default, use this function:
```nix
gitignoreFilterRecursiveSource = filter: patterns: root:
# OR
gitignoreRecursiveSource = gitignoreFilterSourcePure (_: _: true);
```

View File

@@ -0,0 +1,70 @@
<section xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
xml:id="sec-pkgs-nix-gitignore">
<title>pkgs.nix-gitignore</title>
<para>
<function>pkgs.nix-gitignore</function> is a function that acts similarly to <literal>builtins.filterSource</literal> but also allows filtering with the help of the gitignore format.
</para>
<section xml:id="sec-pkgs-nix-gitignore-usage">
<title>Usage</title>
<para>
<literal>pkgs.nix-gitignore</literal> exports a number of functions, but you'll most likely need either <literal>gitignoreSource</literal> or <literal>gitignoreSourcePure</literal>. As their first argument, they both accept either 1. a file with gitignore lines or 2. a string with gitignore lines, or 3. a list of either of the two. They will be concatenated into a single big string.
</para>
<programlisting><![CDATA[
{ pkgs ? import <nixpkgs> {} }:
nix-gitignore.gitignoreSource [] ./source
# Simplest version
nix-gitignore.gitignoreSource "supplemental-ignores\n" ./source
# This one reads the ./source/.gitignore and concats the auxiliary ignores
nix-gitignore.gitignoreSourcePure "ignore-this\nignore-that\n" ./source
# Use this string as gitignore, don't read ./source/.gitignore.
nix-gitignore.gitignoreSourcePure ["ignore-this\nignore-that\n", ~/.gitignore] ./source
# It also accepts a list (of strings and paths) that will be concatenated
# once the paths are turned to strings via readFile.
]]></programlisting>
<para>
These functions are derived from the <literal>Filter</literal> functions by setting the first filter argument to <literal>(_: _: true)</literal>:
</para>
<programlisting><![CDATA[
gitignoreSourcePure = gitignoreFilterSourcePure (_: _: true);
gitignoreSource = gitignoreFilterSource (_: _: true);
]]></programlisting>
<para>
Those filter functions accept the same arguments the <literal>builtins.filterSource</literal> function would pass to its filters, thus <literal>fn: gitignoreFilterSourcePure fn ""</literal> should be extensionally equivalent to <literal>filterSource</literal>. The file is blacklisted iff it's blacklisted by either your filter or the gitignoreFilter.
</para>
<para>
If you want to make your own filter from scratch, you may use
</para>
<programlisting><![CDATA[
gitignoreFilter = ign: root: filterPattern (gitignoreToPatterns ign) root;
]]></programlisting>
</section>
<section xml:id="sec-pkgs-nix-gitignore-usage-recursive">
<title>gitignore files in subdirectories</title>
<para>
If you wish to use a filter that would search for .gitignore files in subdirectories, just like git does by default, use this function:
</para>
<programlisting><![CDATA[
gitignoreFilterRecursiveSource = filter: patterns: root:
# OR
gitignoreRecursiveSource = gitignoreFilterSourcePure (_: _: true);
]]></programlisting>
</section>
</section>

View File

@@ -1,17 +0,0 @@
# prefer-remote-fetch overlay {#sec-prefer-remote-fetch}
`prefer-remote-fetch` is an overlay that download sources on remote builder. This is useful when the evaluating machine has a slow upload while the builder can fetch faster directly from the source. To use it, put the following snippet as a new overlay:
```nix
self: super:
(super.prefer-remote-fetch self super)
```
A full configuration example for that sets the overlay up for your own account, could look like this
```ShellSession
$ mkdir ~/.config/nixpkgs/overlays/
$ cat > ~/.config/nixpkgs/overlays/prefer-remote-fetch.nix <<EOF
self: super: super.prefer-remote-fetch self super
EOF
```

View File

@@ -0,0 +1,21 @@
<section xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/xinclude"
xml:id="sec-prefer-remote-fetch">
<title>prefer-remote-fetch overlay</title>
<para>
<function>prefer-remote-fetch</function> is an overlay that download sources on remote builder. This is useful when the evaluating machine has a slow upload while the builder can fetch faster directly from the source. To use it, put the following snippet as a new overlay:
<programlisting>
self: super:
(super.prefer-remote-fetch self super)
</programlisting>
A full configuration example for that sets the overlay up for your own account, could look like this
<screen>
<prompt>$ </prompt>mkdir ~/.config/nixpkgs/overlays/
<prompt>$ </prompt>cat &gt; ~/.config/nixpkgs/overlays/prefer-remote-fetch.nix &lt;&lt;EOF
self: super: super.prefer-remote-fetch self super
EOF
</screen>
</para>
</section>

View File

@@ -1,6 +1,6 @@
# Agda {#agda}
## How to use Agda {#how-to-use-agda}
## How to use Agda
Agda is available as the [agda](https://search.nixos.org/packages?channel=unstable&show=agda&from=0&size=30&sort=relevance&query=agda)
package.
@@ -43,7 +43,6 @@ agda.withPackages (p: [
```
You can also reference a GitHub repository
```nix
agda.withPackages (p: [
(p.standard-library.overrideAttrs (oldAttrs: {
@@ -60,7 +59,6 @@ agda.withPackages (p: [
If you want to use a library not added to Nixpkgs, you can add a
dependency to a local library by calling `agdaPackages.mkDerivation`.
```nix
agda.withPackages (p: [
(p.mkDerivation {
@@ -94,21 +92,20 @@ See [Building Agda Packages](#building-agda-packages) for more information on `m
Agda will not by default use these libraries. To tell Agda to use a library we have some options:
* Call `agda` with the library flag:
```ShellSession
$ agda -l standard-library -i . MyFile.agda
```
```ShellSession
$ agda -l standard-library -i . MyFile.agda
```
* Write a `my-library.agda-lib` file for the project you are working on which may look like:
```
name: my-library
include: .
depend: standard-library
```
```
name: my-library
include: .
depend: standard-library
```
* Create the file `~/.agda/defaults` and add any libraries you want to use by default.
More information can be found in the [official Agda documentation on library management](https://agda.readthedocs.io/en/v2.6.1/tools/package-system.html).
## Compiling Agda {#compiling-agda}
## Compiling Agda
Agda modules can be compiled using the GHC backend with the `--compile` flag. A version of `ghc` with `ieee754` is made available to the Agda program via the `--with-compiler` flag.
This can be overridden by a different version of `ghc` as follows:
@@ -119,8 +116,7 @@ agda.withPackages {
}
```
## Writing Agda packages {#writing-agda-packages}
## Writing Agda packages
To write a nix derivation for an Agda library, first check that the library has a `*.agda-lib` file.
A derivation can then be written using `agdaPackages.mkDerivation`. This has similar arguments to `stdenv.mkDerivation` with the following additions:
@@ -144,37 +140,19 @@ agdaPackages.mkDerivation {
}
```
### Building Agda packages {#building-agda-packages}
### Building Agda packages
The default build phase for `agdaPackages.mkDerivation` simply runs `agda` on the `Everything.agda` file.
If something else is needed to build the package (e.g. `make`) then the `buildPhase` should be overridden.
Additionally, a `preBuild` or `configurePhase` can be used if there are steps that need to be done prior to checking the `Everything.agda` file.
`agda` and the Agda libraries contained in `buildInputs` are made available during the build phase.
### Installing Agda packages {#installing-agda-packages}
### Installing Agda packages
The default install phase copies Agda source files, Agda interface files (`*.agdai`) and `*.agda-lib` files to the output directory.
This can be overridden.
By default, Agda sources are files ending on `.agda`, or literate Agda files ending on `.lagda`, `.lagda.tex`, `.lagda.org`, `.lagda.md`, `.lagda.rst`. The list of recognised Agda source extensions can be extended by setting the `extraExtensions` config variable.
## Maintaining the Agda package set on Nixpkgs {#maintaining-the-agda-package-set-on-nixpkgs}
We are aiming at providing all common Agda libraries as packages on `nixpkgs`,
and keeping them up to date.
Contributions and maintenance help is always appreciated,
but the maintenance effort is typically low since the Agda ecosystem is quite small.
The `nixpkgs` Agda package set tries to take up a role similar to that of [Stackage](https://www.stackage.org/) in the Haskell world.
It is a curated set of libraries that:
1. Always work together.
2. Are as up-to-date as possible.
While the Haskell ecosystem is huge, and Stackage is highly automatised,
the Agda package set is small and can (still) be maintained by hand.
### Adding Agda packages to Nixpkgs {#adding-agda-packages-to-nixpkgs}
## Adding Agda packages to Nixpkgs
To add an Agda package to `nixpkgs`, the derivation should be written to `pkgs/development/libraries/agda/${library-name}/` and an entry should be added to `pkgs/top-level/agda-packages.nix`. Here it is called in a scope with access to all other Agda libraries, so the top line of the `default.nix` can look like:
@@ -204,53 +182,6 @@ mkDerivation {
'';
}
```
This library has a file called `.agda-lib`, and so we give an empty string to `libraryFile` as nothing precedes `.agda-lib` in the filename. This file contains `name: IAL-1.3`, and so we let `libraryName = "IAL-1.3"`. This library does not use an `Everything.agda` file and instead has a Makefile, so there is no need to set `everythingFile` and we set a custom `buildPhase`.
When writing an Agda package it is essential to make sure that no `.agda-lib` file gets added to the store as a single file (for example by using `writeText`). This causes Agda to think that the nix store is a Agda library and it will attempt to write to it whenever it typechecks something. See [https://github.com/agda/agda/issues/4613](https://github.com/agda/agda/issues/4613).
In the pull request adding this library,
you can test whether it builds correctly by writing in a comment:
```
@ofborg build agdaPackages.iowa-stdlib
```
### Maintaining Agda packages
As mentioned before, the aim is to have a compatible, and up-to-date package set.
These two conditions sometimes exclude each other:
For example, if we update `agdaPackages.standard-library` because there was an upstream release,
this will typically break many reverse dependencies,
i.e. downstream Agda libraries that depend on the standard library.
In `nixpkgs` we are typically among the first to notice this,
since we have build tests in place to check this.
In a pull request updating e.g. the standard library, you should write the following comment:
```
@ofborg build agdaPackages.standard-library.passthru.tests
```
This will build all reverse dependencies of the standard library,
for example `agdaPackages.agda-categories`, or `agdaPackages.generic`.
In some cases it is useful to build _all_ Agda packages.
This can be done with the following Github comment:
```
@ofborg build agda.passthru.tests.allPackages
```
Sometimes, the builds of the reverse dependencies fail because they have not yet been updated and released.
You should drop the maintainers a quick issue notifying them of the breakage,
citing the build error (which you can get from the ofborg logs).
If you are motivated, you might even send a pull request that fixes it.
Usually, the maintainers will answer within a week or two with a new release.
Bumping the version of that reverse dependency should be a further commit on your PR.
In the rare case that a new release is not to be expected within an acceptable time,
simply mark the broken package as broken by setting `meta.broken = true;`.
This will exclude it from the build test.
It can be added later when it is fixed,
and does not hinder the advancement of the whole package set in the meantime.

View File

@@ -3,8 +3,8 @@
The Android build environment provides three major features and a number of
supporting features.
## Deploying an Android SDK installation with plugins {#deploying-an-android-sdk-installation-with-plugins}
Deploying an Android SDK installation with plugins
--------------------------------------------------
The first use case is deploying the SDK with a desired set of plugins or subsets
of an SDK.
@@ -136,8 +136,8 @@ in
androidComposition.platform-tools
```
## Using predefined Android package compositions {#using-predefined-android-package-compositions}
Using predefined Android package compositions
---------------------------------------------
In addition to composing an Android package set manually, it is also possible
to use a predefined composition that contains all basic packages for a specific
Android version, such as version 9.0 (API-level 28).
@@ -159,13 +159,12 @@ with import <nixpkgs> {};
androidenv.androidPkgs_9_0.platform-tools
```
## Building an Android application {#building-an-android-application}
Building an Android application
-------------------------------
In addition to the SDK, it is also possible to build an Ant-based Android
project and automatically deploy all the Android plugins that a project
requires.
```nix
with import <nixpkgs> {};
@@ -200,8 +199,8 @@ to build Android apps. An Android APK gets exposed as a build product and can be
installed on any Android device with a web browser by navigating to the build
result page.
## Spawning emulator instances {#spawning-emulator-instances}
Spawning emulator instances
---------------------------
For testing purposes, it can also be quite convenient to automatically generate
scripts that spawn emulator instances with all desired configuration settings.
@@ -242,8 +241,8 @@ androidenv.emulateApp {
In addition to prebuilt APKs, you can also bind the APK parameter to a
`buildApp {}` function invocation shown in the previous example.
## Notes on environment variables in Android projects {#notes-on-environment-variables-in-android-projects}
Notes on environment variables in Android projects
--------------------------------------------------
* `ANDROID_SDK_ROOT` should point to the Android SDK. In your Nix expressions, this should be
`${androidComposition.androidsdk}/libexec/android-sdk`. Note that `ANDROID_HOME` is deprecated,
but if you rely on tools that need it, you can export it too.
@@ -301,8 +300,8 @@ This shell.nix includes a shell hook that overwrites local.properties with the c
sdk.dir and ndk.dir values. This will ensure that the SDK and NDK directories will
both be correct when you run Android Studio inside nix-shell.
## Notes on improving build.gradle compatibility {#notes-on-improving-build.gradle-compatibility}
Notes on improving build.gradle compatibility
---------------------------------------------
Ensure that your buildToolsVersion and ndkVersion match what is declared in androidenv.
If you are using cmake, make sure its declared version is correct too.
@@ -322,8 +321,8 @@ android {
```
## Querying the available versions of each plugin {#querying-the-available-versions-of-each-plugin}
Querying the available versions of each plugin
----------------------------------------------
repo.json provides all the options in one file now.
A shell script in the `pkgs/development/mobile/androidenv/` subdirectory can be used to retrieve all
@@ -335,8 +334,8 @@ possible options:
The above command-line instruction queries all package versions in repo.json.
## Updating the generated expressions {#updating-the-generated-expressions}
Updating the generated expressions
----------------------------------
repo.json is generated from XML files that the Android Studio package manager uses.
To update the expressions run the `generate.sh` script that is stored in the
`pkgs/development/mobile/androidenv/` subdirectory:

View File

@@ -4,19 +4,13 @@
In this document and related Nix expressions, we use the term, _BEAM_, to describe the environment. BEAM is the name of the Erlang Virtual Machine and, as far as we're concerned, from a packaging perspective, all languages that run on the BEAM are interchangeable. That which varies, like the build system, is transparent to users of any given BEAM package, so we make no distinction.
## Available versions and deprecations schedule {#available-versions-and-deprecations-schedule}
### Elixir {#elixir}
nixpkgs follows the [official elixir deprecation schedule](https://hexdocs.pm/elixir/compatibility-and-deprecations.html) and keeps the last 5 released versions of Elixir available.
## Structure {#beam-structure}
All BEAM-related expressions are available via the top-level `beam` attribute, which includes:
- `interpreters`: a set of compilers running on the BEAM, including multiple Erlang/OTP versions (`beam.interpreters.erlangR22`, etc), Elixir (`beam.interpreters.elixir`) and LFE (Lisp Flavoured Erlang) (`beam.interpreters.lfe`).
- `interpreters`: a set of compilers running on the BEAM, including multiple Erlang/OTP versions (`beam.interpreters.erlangR19`, etc), Elixir (`beam.interpreters.elixir`) and LFE (Lisp Flavoured Erlang) (`beam.interpreters.lfe`).
- `packages`: a set of package builders (Mix and rebar3), each compiled with a specific Erlang/OTP version, e.g. `beam.packages.erlang22`.
- `packages`: a set of package builders (Mix and rebar3), each compiled with a specific Erlang/OTP version, e.g. `beam.packages.erlangR19`.
The default Erlang compiler, defined by `beam.interpreters.erlang`, is aliased as `erlang`. The default BEAM package set is defined by `beam.packages.erlang` and aliased at the top level as `beamPackages`.
@@ -68,107 +62,27 @@ Erlang.mk functions similarly to Rebar3, except we use `buildErlangMk` instead o
`mixRelease` is used to make a release in the mix sense. Dependencies will need to be fetched with `fetchMixDeps` and passed to it.
#### mixRelease - Elixir Phoenix example {#mix-release-elixir-phoenix-example}
#### mixRelease - Elixir Phoenix example
there are 3 steps, frontend dependencies (javascript), backend dependencies (elixir) and the final derivation that puts both of those together
##### mixRelease - Frontend dependencies (javascript) {#mix-release-javascript-deps}
for phoenix projects, inside of nixpkgs you can either use yarn2nix (mkYarnModule) or node2nix. An example with yarn2nix can be found [here](https://github.com/NixOS/nixpkgs/blob/master/pkgs/servers/web-apps/plausible/default.nix#L39). An example with node2nix will follow. To package something outside of nixpkgs, you have alternatives like [npmlock2nix](https://github.com/nix-community/npmlock2nix) or [nix-npm-buildpackage](https://github.com/serokell/nix-npm-buildpackage)
##### mixRelease - backend dependencies (mix) {#mix-release-mix-deps}
There are 2 ways to package backend dependencies. With mix2nix and with a fixed-output-derivation (FOD).
###### mix2nix {#mix2nix}
mix2nix is a cli tool available in nixpkgs. it will generate a nix expression from a mix.lock file. It is quite standard in the 2nix tool series.
Note that currently mix2nix can't handle git dependencies inside the mix.lock file. If you have git dependencies, you can either add them manually (see [example](https://github.com/NixOS/nixpkgs/blob/master/pkgs/servers/pleroma/default.nix#L20)) or use the FOD method.
The advantage of using mix2nix is that nix will know your whole dependency graph. On a dependency update, this won't trigger a full rebuild and download of all the dependencies, where FOD will do so.
practical steps:
- run `mix2nix > mix_deps.nix` in the upstream repo.
- pass `mixNixDeps = with pkgs; import ./mix_deps.nix { inherit lib beamPackages; };` as an argument to mixRelease.
If there are git depencencies.
- You'll need to fix the version artificially in mix.exs and regenerate the mix.lock with fixed version (on upstream). This will enable you to run `mix2nix > mix_deps.nix`.
- From the mix_deps.nix file, remove the dependencies that had git versions and pass them as an override to the import function.
```nix
mixNixDeps = import ./mix.nix {
inherit beamPackages lib;
overrides = (final: prev: {
# mix2nix does not support git dependencies yet,
# so we need to add them manually
prometheus_ex = beamPackages.buildMix rec {
name = "prometheus_ex";
version = "3.0.5";
# Change the argument src with the git src that you actually need
src = fetchFromGitLab {
domain = "git.pleroma.social";
group = "pleroma";
owner = "elixir-libraries";
repo = "prometheus.ex";
rev = "a4e9beb3c1c479d14b352fd9d6dd7b1f6d7deee5";
sha256 = "1v0q4bi7sb253i8q016l7gwlv5562wk5zy3l2sa446csvsacnpjk";
};
# you can re-use the same beamDeps argument as generated
beamDeps = with final; [ prometheus ];
};
});
};
```
You will need to run the build process once to fix the sha256 to correspond to your new git src.
###### FOD {#fixed-output-derivation}
A fixed output derivation will download mix dependencies from the internet. To ensure reproducibility, a hash will be supplied. Note that mix is relatively reproducible. An FOD generating a different hash on each run hasn't been observed (as opposed to npm where the chances are relatively high). See [elixir_ls](https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/beam-modules/elixir_ls.nix) for a usage example of FOD.
Practical steps
- start with the following argument to mixRelease
```nix
mixFodDeps = fetchMixDeps {
pname = "mix-deps-${pname}";
inherit src version;
sha256 = lib.fakeSha256;
};
```
The first build will complain about the sha256 value, you can replace with the suggested value after that.
Note that if after you've replaced the value, nix suggests another sha256, then mix is not fetching the dependencies reproducibly. An FOD will not work in that case and you will have to use mix2nix.
##### mixRelease - example {#mix-release-example}
Here is how your `default.nix` file would look for a phoenix project.
Here is how your `default.nix` file would look.
```nix
with import <nixpkgs> { };
let
# beam.interpreters.erlangR23 is available if you need a particular version
packages = beam.packagesWith beam.interpreters.erlang;
pname = "your_project";
version = "0.0.1";
src = builtins.fetchgit {
url = "ssh://git@github.com/your_id/your_repo";
rev = "replace_with_your_commit";
};
# if using mix2nix you can use the mixNixDeps attribute
mixFodDeps = packages.fetchMixDeps {
pname = "your_project";
version = "0.0.1";
mixEnv = "prod";
mixDeps = packages.fetchMixDeps {
pname = "mix-deps-${pname}";
inherit src version;
inherit src mixEnv version;
# nix will complain and tell you the right value to replace this with
sha256 = lib.fakeSha256;
# if you have build time environment variables add them here
@@ -177,19 +91,45 @@ let
nodeDependencies = (pkgs.callPackage ./assets/default.nix { }).shell.nodeDependencies;
frontEndFiles = stdenvNoCC.mkDerivation {
pname = "frontend-${pname}";
nativeBuildInputs = [ nodejs ];
inherit version src;
buildPhase = ''
cp -r ./assets $TEMPDIR
mkdir -p $TEMPDIR/assets/node_modules/.cache
cp -r ${nodeDependencies}/lib/node_modules $TEMPDIR/assets
export PATH="${nodeDependencies}/bin:$PATH"
cd $TEMPDIR/assets
webpack --config ./webpack.config.js
cd ..
'';
installPhase = ''
cp -r ./priv/static $out/
'';
outputHashAlgo = "sha256";
outputHashMode = "recursive";
# nix will complain and tell you the right value to replace this with
outputHash = lib.fakeSha256;
impureEnvVars = lib.fetchers.proxyImpureEnvVars;
};
in packages.mixRelease {
inherit src pname version mixFodDeps;
inherit src pname version mixEnv mixDeps;
# if you have build time environment variables add them here
MY_ENV_VAR="my_value";
postBuild = ''
ln -sf ${nodeDependencies}/lib/node_modules assets/node_modules
npm run deploy --prefix ./assets
# for external task you need a workaround for the no deps check flag
# https://github.com/phoenixframework/phoenix/issues/2690
mix do deps.loadpaths --no-deps-check, phx.digest
mix phx.digest --no-deps-check
preInstall = ''
mkdir -p ./priv/static
cp -r ${frontEndFiles} ./priv/static
'';
}
```
@@ -202,7 +142,7 @@ Setup will require the following steps:
- you can now `nix-build .`
- To run the release, set the `RELEASE_TMP` environment variable to a directory that your program has write access to. It will be used to store the BEAM settings.
#### Example of creating a service for an Elixir - Phoenix project {#example-of-creating-a-service-for-an-elixir---phoenix-project}
#### Example of creating a service for an Elixir - Phoenix project
In order to create a service with your release, you could add a `service.nix`
in your project with the following
@@ -219,8 +159,6 @@ in
systemd.services.${release_name} = {
wantedBy = [ "multi-user.target" ];
after = [ "network.target" "postgresql.service" ];
# note that if you are connecting to a postgres instance on a different host
# postgresql.service should not be included in the requires.
requires = [ "network-online.target" "postgresql.service" ];
description = "my app";
environment = {
@@ -257,7 +195,6 @@ in
path = [ pkgs.bash ];
};
# in case you have migration scripts or you want to use a remote shell
environment.systemPackages = [ release ];
}
```
@@ -269,18 +206,23 @@ in
Usually, we need to create a `shell.nix` file and do our development inside of the environment specified therein. Just install your version of Erlang and any other interpreters, and then use your normal build tools. As an example with Elixir:
```nix
{ pkgs ? import <nixpkgs> {} }:
{ pkgs ? import "<nixpkgs"> {} }:
with pkgs;
let
elixir = beam.packages.erlangR24.elixir_1_12;
elixir = beam.packages.erlangR22.elixir_1_9;
in
mkShell {
buildInputs = [ elixir ];
ERL_INCLUDE_PATH="${erlang}/lib/erlang/usr/include";
}
```
#### Elixir - Phoenix project {#elixir---phoenix-project}
#### Elixir - Phoenix project
Here is an example `shell.nix`.
@@ -293,7 +235,7 @@ let
git
# replace with beam.packages.erlang.elixir_1_11 if you need
beam.packages.erlang.elixir
nodejs
nodejs-15_x
postgresql_13
# only used for frontend dependencies
# you are free to use yarn2nix as well
@@ -316,7 +258,6 @@ let
# TODO: not sure how to make hex available without installing it afterwards.
mix local.hex --if-missing
export LANG=en_US.UTF-8
# keep your shell history in iex
export ERL_AFLAGS="-kernel shell_history enabled"
# postges related

View File

@@ -149,7 +149,7 @@ A few notes about [Full example — `default.nix`](#ex-buildBowerComponentsDefau
## Troubleshooting {#ssec-bower2nix-troubleshooting}
### ENOCACHE errors from buildBowerComponents {#enocache-errors-from-buildbowercomponents}
### ENOCACHE errors from buildBowerComponents
This means that Bower was looking for a package version which doesn't exist in the generated `bower-packages.nix`.

View File

@@ -1,6 +1,6 @@
# Coq and coq packages {#sec-language-coq}
## Coq derivation: `coq` {#coq-derivation-coq}
## Coq derivation: `coq`
The Coq derivation is overridable through the `coq.override overrides`, where overrides is an attribute set which contains the arguments to override. We recommend overriding either of the following
@@ -8,7 +8,7 @@ The Coq derivation is overridable through the `coq.override overrides`, where ov
* `customOCamlPackage` (optional, defaults to `null`, which lets Coq choose a version automatically), which can be set to any of the ocaml packages attribute of `ocaml-ng` (such as `ocaml-ng.ocamlPackages_4_10` which is the default for Coq 8.11 for example).
* `coq-version` (optional, defaults to the short version e.g. "8.10"), is a version number of the form "x.y" that indicates which Coq's version build behavior to mimic when using a source which is not a release. E.g. `coq.override { version = "d370a9d1328a4e1cdb9d02ee032f605a9d94ec7a"; coq-version = "8.10"; }`.
## Coq packages attribute sets: `coqPackages` {#coq-packages-attribute-sets-coqpackages}
## Coq packages attribute sets: `coqPackages`
The recommended way of defining a derivation for a Coq library, is to use the `coqPackages.mkCoqDerivation` function, which is essentially a specialization of `mkDerivation` taking into account most of the specifics of Coq libraries. The following attributes are supported:
@@ -28,12 +28,11 @@ The recommended way of defining a derivation for a Coq library, is to use the `c
* `domain` (optional, defaults to `"github.com"`), domains including the strings `"github"` or `"gitlab"` in their names are automatically supported, otherwise, one must change the `fetcher` argument to support them (cf `pkgs/development/coq-modules/heq/default.nix` for an example),
* `releaseRev` (optional, defaults to `(v: v)`), provides a default mapping from release names to revision hashes/branch names/tags,
* `displayVersion` (optional), provides a way to alter the computation of `name` from `pname`, by explaining how to display version numbers,
* `namePrefix` (optional, defaults to `[ "coq" ]`), provides a way to alter the computation of `name` from `pname`, by explaining which dependencies must occur in `name`,
* `namePrefix` (optional), provides a way to alter the computation of `name` from `pname`, by explaining which dependencies must occur in `name`,
* `extraBuildInputs` (optional), by default `buildInputs` just contains `coq`, this allows to add more build inputs,
* `mlPlugin` (optional, defaults to `false`). Some extensions (plugins) might require OCaml and sometimes other OCaml packages. Standard dependencies can be added by setting the current option to `true`. For a finer grain control, the `coq.ocamlPackages` attribute can be used in `extraBuildInputs` to depend on the same package set Coq was built against.
* `useDune2ifVersion` (optional, default to `(x: false)` uses Dune2 to build the package if the provided predicate evaluates to true on the version, e.g. `useDune2if = versions.isGe "1.1"` will use dune if the version of the package is greater or equal to `"1.1"`,
* `useDune2` (optional, defaults to `false`) uses Dune2 to build the package if set to true, the presence of this attribute overrides the behavior of the previous one.
* `opam-name` (optional, defaults to concatenating with a dash separator the components of `namePrefix` and `pname`), name of the Dune package to build.
* `enableParallelBuilding` (optional, defaults to `true`), since it is activated by default, we provide a way to disable it.
* `extraInstallFlags` (optional), allows to extend `installFlags` which initializes the variable `COQMF_COQLIB` so as to install in the proper subdirectory. Indeed Coq libraries should be installed in `$(out)/lib/coq/${coq.coq-version}/user-contrib/`. Such directories are automatically added to the `$COQPATH` environment variable by the hook defined in the Coq derivation.
* `setCOQBIN` (optional, defaults to `true`), by default, the environment variable `$COQBIN` is set to the current Coq's binary, but one can disable this behavior by setting it to `false`,

View File

@@ -1,22 +1,20 @@
# Crystal {#crystal}
## Building a Crystal package {#building-a-crystal-package}
## Building a Crystal package
This section uses [Mint](https://github.com/mint-lang/mint) as an example for how to build a Crystal package.
If the Crystal project has any dependencies, the first step is to get a `shards.nix` file encoding those. Get a copy of the project and go to its root directory such that its `shard.lock` file is in the current directory. Executable projects should usually commit the `shard.lock` file, but sometimes that's not the case, which means you need to generate it yourself. With an existing `shard.lock` file, `crystal2nix` can be run.
If the Crystal project has any dependencies, the first step is to get a `shards.nix` file encoding those. Get a copy of the project and go to its root directory such that its `shard.lock` file is in the current directory, then run `crystal2nix` in it
```bash
$ git clone https://github.com/mint-lang/mint
$ cd mint
$ git checkout 0.5.0
$ if [ ! -f shard.lock ]; then nix-shell -p shards --run "shards lock"; fi
$ nix-shell -p crystal2nix --run crystal2nix
```
This should have generated a `shards.nix` file.
Next create a Nix file for your derivation and use `pkgs.crystal.buildCrystalPackage` as follows:
```nix
with import <nixpkgs> {};
crystal.buildCrystalPackage rec {

View File

@@ -50,7 +50,7 @@ expression does not protect the Prelude import with a semantic integrity
check, so the first step is to freeze the expression using `dhall freeze`,
like this:
```ShellSession
```bash
$ dhall freeze --inplace ./true.dhall
```
@@ -113,7 +113,7 @@ in
… which we can then build using this command:
```ShellSession
```bash
$ nix build --file ./example.nix dhallPackages.true
```
@@ -121,7 +121,7 @@ $ nix build --file ./example.nix dhallPackages.true
The above package produces the following directory tree:
```ShellSession
```bash
$ tree -a ./result
result
├── .cache
@@ -135,7 +135,7 @@ result
* `source.dhall` contains the result of interpreting our Dhall package:
```ShellSession
```bash
$ cat ./result/source.dhall
True
```
@@ -143,7 +143,7 @@ result
* The `.cache` subdirectory contains one binary cache product encoding the
same result as `source.dhall`:
```ShellSession
```bash
$ dhall decode < ./result/.cache/dhall/122027abdeddfe8503496adeb623466caa47da5f63abd2bc6fa19f6cfcb73ecfed70
True
```
@@ -151,7 +151,7 @@ result
* `binary.dhall` contains a Dhall expression which handles fetching and decoding
the same cache product:
```ShellSession
```bash
$ cat ./result/binary.dhall
missing sha256:27abdeddfe8503496adeb623466caa47da5f63abd2bc6fa19f6cfcb73ecfed70
$ cp -r ./result/.cache .cache
@@ -168,7 +168,7 @@ to conserve disk space when they are used exclusively as dependencies. For
example, if we build the Prelude package it will only contain the binary
encoding of the expression:
```ShellSession
```bash
$ nix build --file ./example.nix dhallPackages.Prelude
$ tree -a result
@@ -199,7 +199,7 @@ Dhall overlay like this:
… and now the Prelude will contain the fully decoded result of interpreting
the Prelude:
```ShellSession
```bash
$ nix build --file ./example.nix dhallPackages.Prelude
$ tree -a result
@@ -302,7 +302,7 @@ Additionally, `buildDhallGitHubPackage` accepts the same arguments as
You can use the `dhall-to-nixpkgs` command-line utility to automate
packaging Dhall code. For example:
```ShellSession
```bash
$ nix-env --install --attr haskellPackages.dhall-nixpkgs
$ nix-env --install --attr nix-prefetch-git # Used by dhall-to-nixpkgs
@@ -329,12 +329,12 @@ The utility takes care of automatically detecting remote imports and converting
them to package dependencies. You can also use the utility on local
Dhall directories, too:
```ShellSession
```bash
$ dhall-to-nixpkgs directory ~/proj/dhall-semver
{ buildDhallDirectoryPackage, Prelude }:
buildDhallDirectoryPackage {
name = "proj";
src = ~/proj/dhall-semver;
src = /Users/gabriel/proj/dhall-semver;
file = "package.dhall";
source = false;
document = false;
@@ -342,37 +342,6 @@ $ dhall-to-nixpkgs directory ~/proj/dhall-semver
}
```
### Remote imports as fixed-output derivations {#ssec-dhall-remote-imports-as-fod}
`dhall-to-nixpkgs` has the ability to fetch and build remote imports as
fixed-output derivations by using their Dhall integrity check. This is
sometimes easier than manually packaging all remote imports.
This can be used like the following:
```ShellSession
$ dhall-to-nixpkgs directory --fixed-output-derivations ~/proj/dhall-semver
{ buildDhallDirectoryPackage, buildDhallUrl }:
buildDhallDirectoryPackage {
name = "proj";
src = ~/proj/dhall-semver;
file = "package.dhall";
source = false;
document = false;
dependencies = [
(buildDhallUrl {
url = "https://prelude.dhall-lang.org/v17.0.0/package.dhall";
hash = "sha256-ENs8kZwl6QRoM9+Jeo/+JwHcOQ+giT2VjDQwUkvlpD4=";
dhallHash = "sha256:10db3c919c25e9046833df897a8ffe2701dc390fa0893d958c3430524be5a43e";
})
];
}
```
Here, `dhall-semver`'s `Prelude` dependency is fetched and built with the
`buildDhallUrl` helper function, instead of being passed in as a function
argument.
## Overriding dependency versions {#ssec-dhall-overriding-dependency-versions}
Suppose that we change our `true.dhall` example expression to depend on an older
@@ -390,7 +359,7 @@ in Prelude.Bool.not False
If we try to rebuild that expression the build will fail:
```ShellSession
```
$ nix build --file ./example.nix dhallPackages.true
builder for '/nix/store/0f1hla7ff1wiaqyk1r2ky4wnhnw114fi-true.drv' failed with exit code 1; last 10 log lines:
@@ -416,7 +385,7 @@ importing the URL.
However, we can override the default Prelude version by using `dhall-to-nixpkgs`
to create a Dhall package for our desired Prelude:
```ShellSession
```bash
$ dhall-to-nixpkgs github https://github.com/dhall-lang/dhall-lang.git \
--name Prelude \
--directory Prelude \
@@ -427,7 +396,7 @@ $ dhall-to-nixpkgs github https://github.com/dhall-lang/dhall-lang.git \
… and then referencing that package in our Dhall overlay, by either overriding
the Prelude globally for all packages, like this:
```nix
```bash
dhallOverrides = self: super: {
true = self.callPackage ./true.nix { };
@@ -438,7 +407,7 @@ the Prelude globally for all packages, like this:
… or selectively overriding the Prelude dependency for just the `true` package,
like this:
```nix
```bash
dhallOverrides = self: super: {
true = self.callPackage ./true.nix {
Prelude = self.callPackage ./Prelude.nix { };

View File

@@ -1,6 +1,6 @@
# Dotnet {#dotnet}
# Dotnet
## Local Development Workflow {#local-development-workflow}
## Local Development Workflow
For local development, it's recommended to use nix-shell to create a dotnet environment:
@@ -16,7 +16,7 @@ mkShell {
}
```
### Using many sdks in a workflow {#using-many-sdks-in-a-workflow}
### Using many sdks in a workflow
It's very likely that more than one sdk will be needed on a given project. Dotnet provides several different frameworks (E.g dotnetcore, aspnetcore, etc.) as well as many versions for a given framework. Normally, dotnet is able to fetch a framework and install it relative to the executable. However, this would mean writing to the nix store in nixpkgs, which is read-only. To support the many-sdk use case, one can compose an environment using `dotnetCorePackages.combinePackages`:
@@ -28,7 +28,8 @@ mkShell {
packages = [
(with dotnetCorePackages; combinePackages [
sdk_3_1
sdk_5_0
sdk_3_0
sdk_2_1
])
];
}
@@ -36,7 +37,7 @@ mkShell {
This will produce a dotnet installation that has the dotnet 3.1, 3.0, and 2.1 sdk. The first sdk listed will have it's cli utility present in the resulting environment. Example info output:
```ShellSession
```ShellSesssion
$ dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 3.1.101
@@ -59,54 +60,16 @@ $ dotnet --info
Microsoft.NETCore.App 3.1.1 [/nix/store/iiv98i2jdi226dgh4jzkkj2ww7f8jgpd-dotnet-core-combined/shared/Microsoft.NETCore.App]
```
## dotnet-sdk vs dotnetCorePackages.sdk {#dotnet-sdk-vs-dotnetcorepackages.sdk}
## dotnet-sdk vs dotnetCorePackages.sdk
The `dotnetCorePackages.sdk_X_Y` is preferred over the old dotnet-sdk as both major and minor version are very important for a dotnet environment. If a given minor version isn't present (or was changed), then this will likely break your ability to build a project.
## dotnetCorePackages.sdk vs dotnetCorePackages.runtime vs dotnetCorePackages.aspnetcore {#dotnetcorepackages.sdk-vs-dotnetcorepackages.runtime-vs-dotnetcorepackages.aspnetcore}
## dotnetCorePackages.sdk vs dotnetCorePackages.net vs dotnetCorePackages.netcore vs dotnetCorePackages.aspnetcore
The `dotnetCorePackages.sdk` contains both a runtime and the full sdk of a given version. The `runtime` and `aspnetcore` packages are meant to serve as minimal runtimes to deploy alongside already built applications.
The `dotnetCorePackages.sdk` contains both a runtime and the full sdk of a given version. The `net`, `netcore` and `aspnetcore` packages are meant to serve as minimal runtimes to deploy alongside already built applications. For runtime versions >= .NET 5 `net` is used while `netcore` is used for older .NET Core runtime version.
## Packaging a Dotnet Application {#packaging-a-dotnet-application}
## Packaging a Dotnet Application
To package Dotnet applications, you can use `buildDotnetModule`. This has similar arguments to `stdenv.mkDerivation`, with the following additions:
Ideally, we would like to build against the sdk, then only have the dotnet runtime available in the runtime closure.
* `projectFile` has to be used for specifying the dotnet project file relative to the source root. These usually have `.sln` or `.csproj` file extensions.
* `nugetDeps` has to be used to specify the NuGet dependency file. Unfortunately, these cannot be deterministically fetched without a lockfile. This file should be generated using `nuget-to-nix` tool, which is available in nixpkgs.
* `executables` is used to specify which executables get wrapped to `$out/bin`, relative to `$out/lib/$pname`. If this is unset, all executables generated will get installed. If you do not want to install any, set this to `[]`.
* `runtimeDeps` is used to wrap libraries into `LD_LIBRARY_PATH`. This is how dotnet usually handles runtime dependencies.
* `buildType` is used to change the type of build. Possible values are `Release`, `Debug`, etc. By default, this is set to `Release`.
* `dotnet-sdk` is useful in cases where you need to change what dotnet SDK is being used.
* `dotnet-runtime` is useful in cases where you need to change what dotnet runtime is being used. This can be either a regular dotnet runtime, or an aspnetcore.
* `dotnet-test-sdk` is useful in cases where unit tests expect a different dotnet SDK. By default, this is set to the `dotnet-sdk` attribute.
* `testProjectFile` is useful in cases where the regular project file does not contain the unit tests. By default, this is set to the `projectFile` attribute.
* `disabledTests` is used to disable running specific unit tests. This gets passed as: `dotnet test --filter "FullyQualifiedName!={}"`, to ensure compatibility with all unit test frameworks.
* `dotnetRestoreFlags` can be used to pass flags to `dotnet restore`.
* `dotnetBuildFlags` can be used to pass flags to `dotnet build`.
* `dotnetTestFlags` can be used to pass flags to `dotnet test`.
* `dotnetInstallFlags` can be used to pass flags to `dotnet install`.
* `dotnetFlags` can be used to pass flags to all of the above phases.
Here is an example `default.nix`, using some of the previously discussed arguments:
```nix
{ lib, buildDotnetModule, dotnetCorePackages, ffmpeg }:
buildDotnetModule rec {
pname = "someDotnetApplication";
version = "0.1";
src = ./.;
projectFile = "src/project.sln";
nugetDeps = ./deps.nix; # File generated with `nuget-to-nix path/to/src > deps.nix`.
dotnet-sdk = dotnetCorePackages.sdk_3_1;
dotnet-runtime = dotnetCorePackages.net_5_0;
dotnetFlags = [ "--runtime linux-x64" ];
executables = [ "foo" ]; # This wraps "$out/lib/$pname/foo" to `$out/bin/foo`.
executables = []; # Don't install any executables.
runtimeDeps = [ ffmpeg ]; # This will wrap ffmpeg's library path into `LD_LIBRARY_PATH`.
}
```
TODO: Create closure-friendly way to package dotnet applications

View File

@@ -27,14 +27,16 @@ Modes of use of `emscripten`:
* dev-shell for zlib implementation hacking:
* `nix-shell -A emscriptenPackages.zlib`
## Imperative usage {#imperative-usage}
## Imperative usage
A few things to note:
* `export EMCC_DEBUG=2` is nice for debugging
* `~/.emscripten`, the build artifact cache sometimes creates issues and needs to be removed from time to time
## Declarative usage {#declarative-usage}
## Declarative usage
Let's see two different examples from `pkgs/top-level/emscripten-packages.nix`:
@@ -48,7 +50,7 @@ A special requirement of the `pkgs.buildEmscriptenPackage` is the `doCheck = tru
* Use `export EMCC_DEBUG=2` from within a emscriptenPackage's `phase` to get more detailed debug output what is going wrong.
* ~/.emscripten cache is requiring us to set `HOME=$TMPDIR` in individual phases. This makes compilation slower but also makes it more deterministic.
### Usage 1: pkgs.zlib.override {#usage-1-pkgs.zlib.override}
### Usage 1: pkgs.zlib.override
This example uses `zlib` from nixpkgs but instead of compiling **C** to **ELF** it compiles **C** to **JS** since we were using `pkgs.zlib.override` and changed stdenv to `pkgs.emscriptenStdenv`. A few adaptions and hacks were set in place to make it working. One advantage is that when `pkgs.zlib` is updated, it will automatically update this package as well. However, this can also be the downside...
@@ -108,7 +110,7 @@ See the `zlib` example:
'';
});
### Usage 2: pkgs.buildEmscriptenPackage {#usage-2-pkgs.buildemscriptenpackage}
### Usage 2: pkgs.buildEmscriptenPackage
This `xmlmirror` example features a emscriptenPackage which is defined completely from this context and no `pkgs.zlib.override` is used.
@@ -163,7 +165,7 @@ This `xmlmirror` example features a emscriptenPackage which is defined completel
'';
};
### Declarative debugging {#declarative-debugging}
### Declarative debugging
Use `nix-shell -I nixpkgs=/some/dir/nixpkgs -A emscriptenPackages.libz` and from there you can go trough the individual steps. This makes it easy to build a good `unit test` or list the files of the project.
@@ -175,7 +177,7 @@ Use `nix-shell -I nixpkgs=/some/dir/nixpkgs -A emscriptenPackages.libz` and from
6. `buildPhase`
7. ... happy hacking...
## Summary {#summary}
## Summary
Using this toolchain makes it easy to leverage `nix` from NixOS, MacOSX or even Windows (WSL+ubuntu+nix). This toolchain is reproducible, behaves like the rest of the packages from nixpkgs and contains a set of well working examples to learn and adapt from.

View File

@@ -8,30 +8,12 @@ Programs in the GNOME universe are written in various languages but they all use
[GSettings](https://developer.gnome.org/gio/stable/GSettings.html) API is often used for storing settings. GSettings schemas are required, to know the type and other metadata of the stored values. GLib looks for `glib-2.0/schemas/gschemas.compiled` files inside the directories of `XDG_DATA_DIRS`.
On Linux, GSettings API is implemented using [dconf](https://wiki.gnome.org/Projects/dconf) backend. You will need to add `dconf` [GIO module](#ssec-gnome-gio-modules) to `GIO_EXTRA_MODULES` variable, otherwise the `memory` backend will be used and the saved settings will not be persistent.
On Linux, GSettings API is implemented using [dconf](https://wiki.gnome.org/Projects/dconf) backend. You will need to add `dconf` GIO module to `GIO_EXTRA_MODULES` variable, otherwise the `memory` backend will be used and the saved settings will not be persistent.
Last you will need the dconf database D-Bus service itself. You can enable it using `programs.dconf.enable`.
Some applications will also require `gsettings-desktop-schemas` for things like reading proxy configuration or user interface customization. This dependency is often not mentioned by upstream, you should grep for `org.gnome.desktop` and `org.gnome.system` to see if the schemas are needed.
### GIO modules {#ssec-gnome-gio-modules}
GLibs [GIO](https://developer.gnome.org/gio/stable/ch01.html) library supports several [extension points](https://developer.gnome.org/gio/stable/extending-gio.html). Notably, they allow:
* implementing settings backends (already [mentioned](#ssec-gnome-settings))
* adding TLS support
* proxy settings
* virtual file systems
The modules are typically installed to `lib/gio/modules/` directory of a package and you need to add them to `GIO_EXTRA_MODULES` if you need any of those features.
In particular, we recommend:
* adding `dconf.lib` for any software on Linux that reads [GSettings](#ssec-gnome-settings) (even transitivily through e.g. GTKs file manager)
* adding `glib-networking` for any software that accesses network using GIO or libsoup glib-networking contains a module that implements TLS support and loads system-wide proxy settings
To allow software to use various virtual file systems, `gvfs` package can be also added. But that is usually an optional feature so we typically use `gvfs` from the system (e.g. installed globally using NixOS module).
### GdkPixbuf loaders {#ssec-gnome-gdk-pixbuf-loaders}
GTK applications typically use [GdkPixbuf](https://developer.gnome.org/gdk-pixbuf/stable/) to load images. But `gdk-pixbuf` package only supports basic bitmap formats like JPEG, PNG or TIFF, requiring to use third-party loader modules for other formats. This is especially painful since GTK itself includes SVG icons, which cannot be rendered without a loader provided by `librsvg`.
@@ -102,7 +84,7 @@ For convenience, it also adds `dconf.lib` for a GIO module implementing a GSetti
- []{#ssec-gnome-hooks-gobject-introspection} `gobject-introspection` setup hook populates `GI_TYPELIB_PATH` variable with `lib/girepository-1.0` directories of dependencies, which is then added to wrapper by `wrapGAppsHook`. It also adds `share` directories of dependencies to `XDG_DATA_DIRS`, which is intended to promote GIR files but it also [pollutes the closures](https://github.com/NixOS/nixpkgs/issues/32790) of packages using `wrapGAppsHook`.
::: {.warning}
::: warning
The setup hook [currently](https://github.com/NixOS/nixpkgs/issues/56943) does not work in expressions with `strictDeps` enabled, like Python packages. In those cases, you will need to disable it with `strictDeps = false;`.
:::

View File

@@ -13,7 +13,6 @@ In the following is an example expression using `buildGoModule`, the following a
- `vendorSha256`: is the hash of the output of the intermediate fetcher derivation. `vendorSha256` can also take `null` as an input. When `null` is used as a value, rather than fetching the dependencies and vendoring them, we use the vendoring included within the source repo. If you'd like to not have to update this field on dependency changes, run `go mod vendor` in your source repo and set `vendorSha256 = null;`
- `runVend`: runs the vend command to generate the vendor directory. This is useful if your code depends on c code and go mod tidy does not include the needed sources to build.
- `proxyVendor`: Fetches (go mod download) and proxies the vendor directory. This is useful if any dependency has case-insensitive conflicts which will produce platform dependant `vendorSha256` checksums.
```nix
pet = buildGoModule rec {
@@ -45,7 +44,7 @@ pet = buildGoModule rec {
The function `buildGoPackage` builds legacy Go programs, not supporting Go modules.
### Example for `buildGoPackage` {#example-for-buildgopackage}
### Example for `buildGoPackage`
In the following is an example expression using buildGoPackage, the following arguments are of special significance to the function:
@@ -113,31 +112,23 @@ done
Both `buildGoModule` and `buildGoPackage` can be tweaked to behave slightly differently, if the following attributes are used:
### `ldflags` {#var-go-ldflags}
### `buildFlagsArray` and `buildFlags`: {#ex-goBuildFlags-noarray}
Arguments to pass to the Go linker tool via the `-ldflags` argument of `go build`. The most common use case for this argument is to make the resulting executable aware of its own version. For example:
These attributes set build flags supported by `go build`. We recommend using `buildFlagsArray`. The most common use case of these attributes is to make the resulting executable aware of its own version. For example:
```nix
ldflags = [
"-s" "-w"
"-X main.Version=${version}"
"-X main.Commit=${version}"
];
```
### `tags` {#var-go-tags}
Arguments to pass to the Go via the `-tags` argument of `go build`. For example:
```nix
tags = [
"production"
"sqlite"
buildFlagsArray = [
# Note: single quotes are not needed.
"-ldflags=-X main.Version=${version} -X main.Commit=${version}"
];
```
```nix
tags = [ "production" ] ++ lib.optionals withSqlite [ "sqlite" ];
buildFlagsArray = ''
-ldflags=
-X main.Version=${version}
-X main.Commit=${version}
'';
```
### `deleteVendor` {#var-go-deleteVendor}
@@ -146,4 +137,4 @@ Removes the pre-existing vendor directory. This should only be used if the depen
### `subPackages` {#var-go-subPackages}
Limits the builder from building child packages that have not been listed. If `subPackages` is not specified, all child packages will be built.
Limits the builder from building child packages that have not been listed. If <varname>subPackages</varname> is not specified, all child packages will be built.

View File

@@ -1,31 +0,0 @@
# 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 ]))
];
}
```

View File

@@ -1,10 +1,10 @@
# Idris {#idris}
## Installing Idris {#installing-idris}
## Installing Idris
The easiest way to get a working idris version is to install the `idris` attribute:
```ShellSession
```ShellSesssion
$ # On NixOS
$ nix-env -i nixos.idris
$ # On non-NixOS
@@ -21,7 +21,7 @@ self: super: {
And then:
```ShellSession
```ShellSesssion
$ # On NixOS
$ nix-env -iA nixos.myIdris
$ # On non-NixOS
@@ -29,8 +29,7 @@ $ nix-env -iA nixpkgs.myIdris
```
To see all available Idris packages:
```ShellSession
```ShellSesssion
$ # On NixOS
$ nix-env -qaPA nixos.idrisPackages
$ # On non-NixOS
@@ -38,23 +37,22 @@ $ nix-env -qaPA nixpkgs.idrisPackages
```
Similarly, entering a `nix-shell`:
```ShellSession
```ShellSesssion
$ nix-shell -p 'idrisPackages.with-packages (with idrisPackages; [ contrib pruviloj ])'
```
## Starting Idris with library support {#starting-idris-with-library-support}
## Starting Idris with library support
To have access to these libraries in idris, call it with an argument `-p <library name>` for each library:
```ShellSession
```ShellSesssion
$ nix-shell -p 'idrisPackages.with-packages (with idrisPackages; [ contrib pruviloj ])'
[nix-shell:~]$ idris -p contrib -p pruviloj
```
A listing of all available packages the Idris binary has access to is available via `--listlibs`:
```ShellSession
```ShellSesssion
$ idris --listlibs
00prelude-idx.ibc
pruviloj
@@ -66,7 +64,7 @@ prelude
00contrib-idx.ibc
```
## Building an Idris project with Nix {#building-an-idris-project-with-nix}
## Building an Idris project with Nix
As an example of how a Nix expression for an Idris package can be created, here is the one for `idrisPackages.yaml`:
@@ -107,7 +105,7 @@ build-idris-package {
Assuming this file is saved as `yaml.nix`, it's buildable using
```ShellSession
```ShellSesssion
$ nix-build -E '(import <nixpkgs> {}).idrisPackages.callPackage ./yaml.nix {}'
```
@@ -123,11 +121,11 @@ with import <nixpkgs> {};
in another file (say `default.nix`) to be able to build it with
```ShellSession
```ShellSesssion
$ nix-build -A yaml
```
## Passing options to `idris` commands {#passing-options-to-idris-commands}
## Passing options to `idris` commands
The `build-idris-package` function provides also optional input values to set additional options for the used `idris` commands.

View File

@@ -12,21 +12,17 @@
<xi:include href="coq.section.xml" />
<xi:include href="crystal.section.xml" />
<xi:include href="dhall.section.xml" />
<xi:include href="dotnet.section.xml" />
<xi:include href="emscripten.section.xml" />
<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" />
<xi:include href="javascript.section.xml" />
<xi:include href="lua.section.xml" />
<xi:include href="maven.section.xml" />
<xi:include href="nim.section.xml" />
<xi:include href="node.section.xml" />
<xi:include href="ocaml.section.xml" />
<xi:include href="octave.section.xml" />
<xi:include href="perl.section.xml" />
<xi:include href="php.section.xml" />
<xi:include href="python.section.xml" />

View File

@@ -20,8 +20,8 @@ Hydra.
The Xcode build environment implements a number of features.
## Deploying a proxy component wrapper exposing Xcode {#deploying-a-proxy-component-wrapper-exposing-xcode}
Deploying a proxy component wrapper exposing Xcode
--------------------------------------------------
The first use case is deploying a Nix package that provides symlinks to the Xcode
installation on the host system. This package can be used as a build input to
any build function implemented in the Nix expression language that requires
@@ -55,8 +55,8 @@ lrwxr-xr-x 1 sander staff 61 1 jan 1970 xcodebuild -> /Applications/Xcode.a
lrwxr-xr-x 1 sander staff 14 1 jan 1970 xcrun -> /usr/bin/xcrun
```
## Building an iOS application {#building-an-ios-application}
Building an iOS application
---------------------------
We can build an iOS app executable for the simulator, or an IPA/xcarchive file
for release purposes, e.g. ad-hoc, enterprise or store installations, by
executing the `xcodeenv.buildApp {}` function:
@@ -99,7 +99,6 @@ xcodeenv.buildApp {
```
The above function takes a variety of parameters:
* The `name` and `src` parameters are mandatory and specify the name of the app
and the location where the source code resides
* `sdkVersion` specifies which version of the iOS SDK to use.
@@ -152,8 +151,8 @@ the `xcodeenv.composeXcodeWrapper {}` function takes. For example, the
`xcodeBaseDir` parameter can be overridden to refer to a different Xcode
version.
## Spawning simulator instances {#spawning-simulator-instances}
Spawning simulator instances
----------------------------
In addition to building iOS apps, we can also automatically spawn simulator
instances:
@@ -214,8 +213,8 @@ xcode.simulateApp {
By providing the result of an `xcode.buildApp {}` function and configuring the
app bundle id, the app gets deployed automatically and started.
## Troubleshooting {#troubleshooting}
Troubleshooting
---------------
In some rare cases, it may happen that after a failure, changes are not picked
up. Most likely, this is caused by a derived data cache that Xcode maintains.
To wipe it you can run:

View File

@@ -72,15 +72,6 @@ in
...
```
You can also specify what JDK your JRE should be based on, for example
selecting a 'headless' build to avoid including a link to GTK+:
```nix
my_jre = pkgs.jre_minimal.override {
jdk = jdk11_headless;
};
```
Note all JDKs passthru `home`, so if your application requires
environment variables like `JAVA_HOME` being set, that can be done in a
generic fashion with the `--set` argument of `makeWrapper`:

View File

@@ -1,256 +0,0 @@
# Javascript {#language-javascript}
## Introduction {#javascript-introduction}
This contains instructions on how to package javascript applications.
The various tools available will be listed in the [tools-overview](#javascript-tools-overview). Some general principles for packaging will follow. Finally some tool specific instructions will be given.
## Getting unstuck / finding code examples
If you find you are lacking inspiration for packing javascript applications, the links below might prove useful.
Searching online for prior art can be helpful if you are running into solved problems.
### Github
- Searching Nix files for `mkYarnPackage`: <https://github.com/search?q=mkYarnPackage+language%3ANix&type=code>
- Searching just `flake.nix` files for `mkYarnPackage`: <https://github.com/search?q=mkYarnPackage+filename%3Aflake.nix&type=code>
### Gitlab
- Searching Nix files for `mkYarnPackage`: <https://gitlab.com/search?scope=blobs&search=mkYarnPackage+extension%3Anix>
- Searching just `flake.nix` files for `mkYarnPackage`: <https://gitlab.com/search?scope=blobs&search=mkYarnPackage+filename%3Aflake.nix>
## Tools overview {#javascript-tools-overview}
## General principles {#javascript-general-principles}
The following principles are given in order of importance with potential exceptions.
### Try to use the same node version used upstream {#javascript-upstream-node-version}
It is often not documented which node version is used upstream, but if it is, try to use the same version when packaging.
This can be a problem if upstream is using the latest and greatest and you are trying to use an earlier version of node. Some cryptic errors regarding V8 may appear.
An exception to this:
### Try to respect the package manager originally used by upstream (and use the upstream lock file) {#javascript-upstream-package-manager}
A lock file (package-lock.json, yarn.lock...) is supposed to make reproducible installations of node_modules for each tool.
Guidelines of package managers, recommend to commit those lock files to the repos. If a particular lock file is present, it is a strong indication of which package manager is used upstream.
It's better to try to use a nix tool that understand the lock file. Using a different tool might give you hard to understand error because different packages have been installed. An example of problems that could arise can be found [here](https://github.com/NixOS/nixpkgs/pull/126629). Upstream uses npm, but this is an attempt to package it with yarn2nix (that uses yarn.lock)
Using a different tool forces to commit a lock file to the repository. Those files are fairly large, so when packaging for nixpkgs, this approach does not scale well.
Exceptions to this rule are:
- when you encounter one of the bugs from a nix tool. In each of the tool specific instructions, known problems will be detailed. If you have a problem with a particular tool, then it's best to try another tool, even if this means you will have to recreate a lock file and commit it to nixpkgs. In general yarn2nix has less known problems and so a simple search in nixpkgs will reveal many yarn.lock files committed
- Some lock files contain particular version of a package that has been pulled off npm for some reason. In that case, you can recreate upstream lock (by removing the original and `npm install`, `yarn`, ...) and commit this to nixpkgs.
- The only tool that supports workspaces (a feature of npm that helps manage sub-directories with different package.json from a single top level package.json) is yarn2nix. If upstream has workspaces you should try yarn2nix.
### Try to use upstream package.json {#javascript-upstream-package-json}
Exceptions to this rule are
- Sometimes the upstream repo assumes some dependencies be installed globally. In that case you can add them manually to the upstream package.json (`yarn add xxx` or `npm install xxx`, ...). Dependencies that are installed locally can be executed with `npx` for cli tools. (e.g. `npx postcss ...`, this is how you can call those dependencies in the phases).
- Sometimes there is a version conflict between some dependency requirements. In that case you can fix a version (by removing the `^`).
- Sometimes the script defined in the package.json does not work as is. Some scripts for example use cli tools that might not be available, or cd in directory with a different package.json (for workspaces notably). In that case, it's perfectly fine to look at what the particular script is doing and break this down in the phases. In the build script you can see `build:*` calling in turns several other build scripts like `build:ui` or `build:server`. If one of those fails, you can try to separate those into:
```Shell
yarn build:ui
yarn build:server
# OR
npm run build:ui
npm run build:server
```
when you need to override a package.json. It's nice to use the one from the upstream src and do some explicit override. Here is an example.
```nix
patchedPackageJSON = final.runCommand "package.json" { } ''
${jq}/bin/jq '.version = "0.4.0" |
.devDependencies."@jsdoc/cli" = "^0.2.5"
${sonar-src}/package.json > $out
'';
```
you will still need to commit the modified version of the lock files, but at least the overrides are explicit for everyone to see.
### Using node_modules directly {#javascript-using-node_modules}
each tool has an abstraction to just build the node_modules (dependencies) directory. you can always use the stdenv.mkDerivation with the node_modules to build the package (symlink the node_modules directory and then use the package build command). the node_modules abstraction can be also used to build some web framework frontends. For an example of this see how [plausible](https://github.com/NixOS/nixpkgs/blob/master/pkgs/servers/web-apps/plausible/default.nix) is built. mkYarnModules to make the derivation containing node_modules. Then when building the frontend you can just symlink the node_modules directory
## javascript packages inside nixpkgs {#javascript-packages-nixpkgs}
The `pkgs/development/node-packages` folder contains a generated collection of
[NPM packages](https://npmjs.com/) that can be installed with the Nix package
manager.
As a rule of thumb, the package set should only provide _end user_ software
packages, such as command-line utilities. Libraries should only be added to the
package set if there is a non-NPM package that requires it.
When it is desired to use NPM libraries in a development project, use the
`node2nix` generator directly on the `package.json` configuration file of the
project.
The package set provides support for the official stable Node.js versions.
The latest stable LTS release in `nodePackages`, as well as the latest stable
Current release in `nodePackages_latest`.
If your package uses native addons, you need to examine what kind of native
build system it uses. Here are some examples:
- `node-gyp`
- `node-gyp-builder`
- `node-pre-gyp`
After you have identified the correct system, you need to override your package
expression while adding in build system as a build input. For example, `dat`
requires `node-gyp-build`, so [we override](https://github.com/NixOS/nixpkgs/blob/32f5e5da4a1b3f0595527f5195ac3a91451e9b56/pkgs/development/node-packages/default.nix#L37-L40) its expression in [`default.nix`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/node-packages/default.nix):
```nix
dat = super.dat.override {
buildInputs = [ self.node-gyp-build pkgs.libtool pkgs.autoconf pkgs.automake ];
meta.broken = since "12";
};
```
To add a package from NPM to nixpkgs:
1. Modify `pkgs/development/node-packages/node-packages.json` to add, update
or remove package entries to have it included in `nodePackages` and
`nodePackages_latest`.
2. Run the script: `cd pkgs/development/node-packages && ./generate.sh`.
3. Build your new package to test your changes:
`cd /path/to/nixpkgs && nix-build -A nodePackages.<new-or-updated-package>`.
To build against the latest stable Current Node.js version (e.g. 14.x):
`nix-build -A nodePackages_latest.<new-or-updated-package>`
4. Add and commit all modified and generated files.
For more information about the generation process, consult the
[README.md](https://github.com/svanderburg/node2nix) file of the `node2nix`
tool.
## Tool specific instructions {#javascript-tool-specific}
### node2nix {#javascript-node2nix}
#### Preparation {#javascript-node2nix-preparation}
you will need to generate a nix expression for the dependencies
- don't forget the `-l package-lock.json` if there is a lock file
- Most probably you will need the `--development` to include the `devDependencies`
so the command will most likely be
`node2nix --development -l package-lock.json`
[link to the doc in the repo](https://github.com/svanderburg/node2nix)
#### Pitfalls {#javascript-node2nix-pitfalls}
- if upstream package.json does not have a "version" attribute, node2nix will crash. You will need to add it like shown in [the package.json section](#javascript-upstream-package-json)
- node2nix has some [bugs](https://github.com/svanderburg/node2nix/issues/238). related to working with lock files from npm distributed with nodejs-16_x
- node2nix does not like missing packages from npm. If you see something like `Cannot resolve version: vue-loader-v16@undefined` then you might want to try another tool. The package might have been pulled off of npm.
### yarn2nix {#javascript-yarn2nix}
#### Preparation {#javascript-yarn2nix-preparation}
you will need at least a yarn.lock and yarn.nix file
- generate a yarn.lock in upstream if it is not already there
- `yarn2nix > yarn.nix` will generate the dependencies in a nix format
#### mkYarnPackage {#javascript-yarn2nix-mkYarnPackage}
this will by default try to generate a binary. For package only generating static assets (Svelte, Vue, React...), you will need to explicitly override the build step with your instructions. It's important to use the `--offline` flag. For example if you script is `"build": "something"` in package.json use
```nix
buildPhase = ''
yarn build --offline
'';
```
The dist phase is also trying to build a binary, the only way to override it is with
```nix
distPhase = "true";
```
the configure phase can sometimes fail because it tries to be too clever.
One common override is
```nix
configurePhase = "ln -s $node_modules node_modules";
```
#### mkYarnModules {#javascript-yarn2nix-mkYarnModules}
this will generate a derivation including the node_modules. If you have to build a derivation for an integrated web framework (rails, phoenix..), this is probably the easiest way. [Plausible](https://github.com/NixOS/nixpkgs/blob/master/pkgs/servers/web-apps/plausible/default.nix#L39) offers a good example of how to do this.
#### Overriding dependency behavior
In the `mkYarnPackage` record the property `pkgConfig` can be used to override packages when you encounter problems building.
For instance, say your package is throwing errors when trying to invoke node-sass: `ENOENT: no such file or directory, scandir '/build/source/node_modules/node-sass/vendor'`
To fix this we will specify different versions of build inputs to use, as well as some post install steps to get the software built the way we want:
```nix
mkYarnPackage rec {
pkgConfig = {
node-sass = {
buildInputs = with final;[ python libsass pkg-config ];
postInstall = ''
LIBSASS_EXT=auto yarn --offline run build
rm build/config.gypi
'';
};
};
}
```
#### Pitfalls {#javascript-yarn2nix-pitfalls}
- if version is missing from upstream package.json, yarn will silently install nothing. In that case, you will need to override package.json as shown in the [package.json section](#javascript-upstream-package-json)
- having trouble with node-gyp? Try adding these lines to the `yarnPreBuild` steps:
```nix
yarnPreBuild = ''
mkdir -p $HOME/.node-gyp/${nodejs.version}
echo 9 > $HOME/.node-gyp/${nodejs.version}/installVersion
ln -sfv ${nodejs}/include $HOME/.node-gyp/${nodejs.version}
export npm_config_nodedir=${nodejs}
'';
```
- The `echo 9` steps comes from this answer: <https://stackoverflow.com/a/49139496>
- Exporting the headers in `npm_config_nodedir` comes from this issue: <https://github.com/nodejs/node-gyp/issues/1191#issuecomment-301243919>
## Outside of nixpkgs {#javascript-outside-nixpkgs}
There are some other options available that can't be used inside nixpkgs. Those other options are written in nix. Importing them in nixpkgs will require moving the source code into nixpkgs. Using [Import From Derivation](https://nixos.wiki/wiki/Import_From_Derivation) is not allowed in hydra at present. If you are packaging something outside nixpkgs, those can be considered
### npmlock2nix {#javascript-npmlock2nix}
[npmlock2nix](https://github.com/nix-community/npmlock2nix) aims at building node_modules without code generation. It hasn't reached v1 yet, the api might be subject to change.
#### Pitfalls {#javascript-npmlock2nix-pitfalls}
- there are some [problems with npm v7](https://github.com/tweag/npmlock2nix/issues/45).
### nix-npm-buildpackage {#javascript-nix-npm-buildpackage}
[nix-npm-buildpackage](https://github.com/serokell/nix-npm-buildpackage) aims at building node_modules without code generation. It hasn't reached v1 yet, the api might change. It supports both package-lock.json and yarn.lock.
#### Pitfalls {#javascript-nix-npm-buildpackage-pitfalls}
- there are some [problems with npm v7](https://github.com/serokell/nix-npm-buildpackage/issues/33).

View File

@@ -1,8 +1,8 @@
# Users Guide to Lua Infrastructure {#users-guide-to-lua-infrastructure}
# User's Guide to Lua Infrastructure {#users-guide-to-lua-infrastructure}
## Using Lua {#using-lua}
## Using Lua
### Overview of Lua {#overview-of-lua}
### Overview of Lua
Several versions of the Lua interpreter are available: luajit, lua 5.1, 5.2, 5.3.
The attribute `lua` refers to the default interpreter, it is also possible to refer to specific versions, e.g. `lua5_2` refers to Lua 5.2.
@@ -17,31 +17,27 @@ The main package set contains aliases to these package sets, e.g.
`luaPackages` refers to `lua5_1.pkgs` and `lua52Packages` to
`lua5_2.pkgs`.
### Installing Lua and packages {#installing-lua-and-packages}
### Installing Lua and packages
#### Lua environment defined in separate `.nix` file {#lua-environment-defined-in-separate-.nix-file}
#### Lua environment defined in separate `.nix` file
Create a file, e.g. `build.nix`, with the following expression
```nix
with import <nixpkgs> {};
lua5_2.withPackages (ps: with ps; [ busted luafilesystem ])
```
and install it in your profile with
```shell
nix-env -if build.nix
```
Now you can use the Lua interpreter, as well as the extra packages (`busted`,
`luafilesystem`) that you added to the environment.
#### Lua environment defined in `~/.config/nixpkgs/config.nix` {#lua-environment-defined-in-.confignixpkgsconfig.nix}
#### Lua environment defined in `~/.config/nixpkgs/config.nix`
If you prefer to, you could also add the environment as a package override to the Nixpkgs set, e.g.
using `config.nix`,
```nix
{ # ...
@@ -50,16 +46,14 @@ using `config.nix`,
};
}
```
and install it in your profile with
```shell
nix-env -iA nixpkgs.myLuaEnv
```
The environment is installed by referring to the attribute, and considering
the `nixpkgs` channel was used.
#### Lua environment defined in `/etc/nixos/configuration.nix` {#lua-environment-defined-in-etcnixosconfiguration.nix}
#### Lua environment defined in `/etc/nixos/configuration.nix`
For the sake of completeness, here's another example how to install the environment system-wide.
@@ -72,7 +66,7 @@ For the sake of completeness, here's another example how to install the environm
}
```
### How to override a Lua package using overlays? {#how-to-override-a-lua-package-using-overlays}
### How to override a Lua package using overlays?
Use the following overlay template:
@@ -93,22 +87,18 @@ final: prev:
}
```
### Temporary Lua environment with `nix-shell` {#temporary-lua-environment-with-nix-shell}
### Temporary Lua environment with `nix-shell`
There are two methods for loading a shell with Lua packages. The first and recommended method
is to create an environment with `lua.buildEnv` or `lua.withPackages` and load that. E.g.
```sh
$ nix-shell -p 'lua.withPackages(ps: with ps; [ busted luafilesystem ])'
```
opens a shell from which you can launch the interpreter
```sh
[nix-shell:~] lua
```
The other method, which is not recommended, does not create an environment and requires you to list the packages directly,
```sh
@@ -118,7 +108,7 @@ Again, it is possible to launch the interpreter from the shell.
The Lua interpreter has the attribute `pkgs` which contains all Lua libraries for that specific interpreter.
## Developing with Lua {#developing-with-lua}
## Developing with Lua
Now that you know how to get a working Lua environment with Nix, it is time
to go forward and start actually developing with Lua. There are two ways to
@@ -126,7 +116,7 @@ package lua software, either it is on luarocks and most of it can be taken care
of by the luarocks2nix converter or the packaging has to be done manually.
Let's present the luarocks way first and the manual one in a second time.
### Packaging a library on luarocks {#packaging-a-library-on-luarocks}
### Packaging a library on luarocks
[Luarocks.org](www.luarocks.org) is the main repository of lua packages.
The site proposes two types of packages, the rockspec and the src.rock
@@ -139,15 +129,16 @@ the whitelist maintainers/scripts/luarocks-packages.csv and updated by running m
[luarocks2nix](https://github.com/nix-community/luarocks) is a tool capable of generating nix derivations from both rockspec and src.rock (and favors the src.rock).
The automation only goes so far though and some packages need to be customized.
These customizations go in `pkgs/development/lua-modules/overrides.nix`.
For instance if the rockspec defines `external_dependencies`, these need to be manually added to the overrides.nix.
For instance if the rockspec defines `external_dependencies`, these need to be manually added in its rockspec file then it won't work.
You can try converting luarocks packages to nix packages with the command `nix-shell -p luarocks-nix` and then `luarocks nix PKG_NAME`.
Nix rely on luarocks to install lua packages, basically it runs:
`luarocks make --deps-mode=none --tree $out`
#### Packaging a library manually {#packaging-a-library-manually}
#### Packaging a library manually
You can develop your package as you usually would, just don't forget to wrap it
within a `toLuaModule` call, for instance
```nix
mynewlib = toLuaModule ( stdenv.mkDerivation { ... });
```
@@ -155,15 +146,16 @@ mynewlib = toLuaModule ( stdenv.mkDerivation { ... });
There is also the `buildLuaPackage` function that can be used when lua modules
are not packaged for luarocks. You can see a few examples at `pkgs/top-level/lua-packages.nix`.
## Lua Reference {#lua-reference}
## Lua Reference
### Lua interpreters {#lua-interpreters}
### Lua interpreters
Versions 5.1, 5.2, 5.3 and 5.4 of the lua interpreter are available as
respectively `lua5_1`, `lua5_2`, `lua5_3` and `lua5_4`. Luajit is available too.
Versions 5.1, 5.2 and 5.3 of the lua interpreter are available as
respectively `lua5_1`, `lua5_2` and `lua5_3`. Luajit is available too.
The Nix expressions for the interpreters can be found in `pkgs/development/interpreters/lua-5`.
#### Attributes on lua interpreters packages {#attributes-on-lua-interpreters-packages}
#### Attributes on lua interpreters packages
Each interpreter has the following attributes:
@@ -172,7 +164,8 @@ Each interpreter has the following attributes:
- `withPackages`. Simpler interface to `buildEnv`.
- `pkgs`. Set of Lua packages for that specific interpreter. The package set can be modified by overriding the interpreter and passing `packageOverrides`.
#### `buildLuarocksPackage` function {#buildluarockspackage-function}
#### `buildLuarocksPackage` function
The `buildLuarocksPackage` function is implemented in `pkgs/development/interpreters/lua-5/build-lua-package.nix`
The following is an example:
@@ -212,17 +205,16 @@ install the package
By default `meta.platforms` is set to the same value as the interpreter unless overridden otherwise.
#### `buildLuaApplication` function {#buildluaapplication-function}
#### `buildLuaApplication` function
The `buildLuaApplication` function is practically the same as `buildLuaPackage`.
The difference is that `buildLuaPackage` by default prefixes the names of the packages with the version of the interpreter.
Because with an application we're not interested in multiple version the prefix is dropped.
#### lua.withPackages function {#lua.withpackages-function}
#### lua.withPackages function
The `lua.withPackages` takes a function as an argument that is passed the set of lua packages and returns the list of packages to be included in the environment.
Using the `withPackages` function, the previous example for the luafilesystem environment can be written like this:
```nix
with import <nixpkgs> {};
@@ -231,7 +223,6 @@ lua.withPackages (ps: [ps.luafilesystem])
`withPackages` passes the correct package set for the specific interpreter version as an argument to the function. In the above example, `ps` equals `luaPackages`.
But you can also easily switch to using `lua5_2`:
```nix
with import <nixpkgs> {};
@@ -240,12 +231,13 @@ lua5_2.withPackages (ps: [ps.lua])
Now, `ps` is set to `lua52Packages`, matching the version of the interpreter.
### Possible Todos {#possible-todos}
### Possible Todos
* export/use version specific variables such as `LUA_PATH_5_2`/`LUAROCKS_CONFIG_5_2`
* let luarocks check for dependencies via exporting the different rocktrees in temporary config
### Lua Contributing guidelines {#lua-contributing-guidelines}
### Lua Contributing guidelines
Following rules should be respected:

View File

@@ -43,9 +43,9 @@ public class Main {
You find this demo project at https://github.com/fzakaria/nixos-maven-example
## Solving for dependencies {#solving-for-dependencies}
## Solving for dependencies
### buildMaven with NixOS/mvn2nix-maven-plugin {#buildmaven-with-nixosmvn2nix-maven-plugin}
### buildMaven with NixOS/mvn2nix-maven-plugin
> ⚠️ Although `buildMaven` is the "blessed" way within nixpkgs, as of 2020, it hasn't seen much activity in quite a while.
@@ -82,7 +82,6 @@ This file is then given to the `buildMaven` function, and it returns 2 attribute
A simple derivation that runs through `mvn compile` & `mvn package` to build the JAR. You may use this as inspiration for more complicated derivations.
Here is an [example](https://github.com/fzakaria/nixos-maven-example/blob/main/build-maven-repository.nix) of building the Maven repository
```nix
{ pkgs ? import <nixpkgs> { } }:
with pkgs;
@@ -104,8 +103,7 @@ The benefit over the _double invocation_ as we will see below, is that the _/nix
│   └── 4.1.3
│   ├── avalon-framework-4.1.3.jar -> /nix/store/iv5fp3955w3nq28ff9xfz86wvxbiw6n9-avalon-framework-4.1.3.jar
```
### Double Invocation {#double-invocation}
### Double Invocation
> ⚠️ This pattern is the simplest but may cause unnecessary rebuilds due to the output hash changing.
@@ -165,7 +163,7 @@ The build will fail, and tell you the expected `outputHash` to place. When you'v
If your package uses _SNAPSHOT_ dependencies or _version ranges_; there is a strong likelihood that over-time your output hash will change since the resolved dependencies may change. Hence this method is less recommended then using `buildMaven`.
## Building a JAR {#building-a-jar}
## Building a JAR
Regardless of which strategy is chosen above, the step to build the derivation is the same.
@@ -203,7 +201,7 @@ in stdenv.mkDerivation rec {
2 directories, 1 file
```
## Runnable JAR {#runnable-jar}
## Runnable JAR
The previous example builds a `jar` file but that's not a file one can run.
@@ -215,7 +213,7 @@ We will use the same repository we built above (either _double invocation_ or _b
The following two methods are more suited to Nix then building an [UberJar](https://imagej.net/Uber-JAR) which may be the more traditional approach.
### CLASSPATH {#classpath}
### CLASSPATH
> This is ideal if you are providing a derivation for _nixpkgs_ and don't want to patch the project's `pom.xml`.
@@ -254,12 +252,11 @@ in stdenv.mkDerivation rec {
}
```
### MANIFEST file via Maven Plugin {#manifest-file-via-maven-plugin}
### MANIFEST file via Maven Plugin
> This is ideal if you are the project owner and want to change your `pom.xml` to set the CLASSPATH within it.
Augment the `pom.xml` to create a JAR with the following manifest:
```xml
<build>
<plugins>

View File

@@ -1,91 +0,0 @@
# Nim {#nim}
## Overview {#nim-overview}
The Nim compiler, a builder function, and some packaged libraries are available
in Nixpkgs. Until now each compiler release has been effectively backwards
compatible so only the latest version is available.
## Nim program packages in Nixpkgs {#nim-program-packages-in-nixpkgs}
Nim programs can be built using `nimPackages.buildNimPackage`. In the
case of packages not containing exported library code the attribute
`nimBinOnly` should be set to `true`.
The following example shows a Nim program that depends only on Nim libraries:
```nix
{ lib, nimPackages, fetchurl }:
nimPackages.buildNimPackage rec {
pname = "hottext";
version = "1.4";
nimBinOnly = true;
src = fetchurl {
url = "https://git.sr.ht/~ehmry/hottext/archive/v${version}.tar.gz";
sha256 = "sha256-hIUofi81zowSMbt1lUsxCnVzfJGN3FEiTtN8CEFpwzY=";
};
buildInputs = with nimPackages; [
bumpy
chroma
flatty
nimsimd
pixie
sdl2
typography
vmath
zippy
];
}
```
## Nim library packages in Nixpkgs {#nim-library-packages-in-nixpkgs}
Nim libraries can also be built using `nimPackages.buildNimPackage`, but
often the product of a fetcher is sufficient to satisfy a dependency.
The `fetchgit`, `fetchFromGitHub`, and `fetchNimble` functions yield an
output that can be discovered during the `configurePhase` of `buildNimPackage`.
Nim library packages are listed in
[pkgs/top-level/nim-packages.nix](https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/nim-packages.nix) and implemented at
[pkgs/development/nim-packages](https://github.com/NixOS/nixpkgs/tree/master/pkgs/development/nim-packages).
The following example shows a Nim library that propagates a dependency on a
non-Nim package:
```nix
{ lib, buildNimPackage, fetchNimble, SDL2 }:
buildNimPackage rec {
pname = "sdl2";
version = "2.0.4";
src = fetchNimble {
inherit pname version;
hash = "sha256-Vtcj8goI4zZPQs2TbFoBFlcR5UqDtOldaXSH/+/xULk=";
};
propagatedBuildInputs = [ SDL2 ];
}
```
## `buildNimPackage` parameters {#buildnimpackage-parameters}
All parameters from `stdenv.mkDerivation` function are still supported. The
following are specific to `buildNimPackage`:
* `nimBinOnly ? false`: If `true` then build only the programs listed in
the Nimble file in the packages sources.
* `nimbleFile`: Specify the Nimble file location of the package being built
rather than discover the file at build-time.
* `nimRelease ? true`: Build the package in *release* mode.
* `nimDefines ? []`: A list of Nim defines. Key-value tuples are not supported.
* `nimFlags ? []`: A list of command line arguments to pass to the Nim compiler.
Use this to specify defines with arguments in the form of `-d:${name}=${value}`.
* `nimDoc` ? false`: Build and install HTML documentation.
* `buildInputs` ? []: The packages listed here will be searched for `*.nimble`
files which are used to populate the Nim library path. Otherwise the standard
behavior is in effect.

View File

@@ -0,0 +1,51 @@
# Node.js {#node.js}
The `pkgs/development/node-packages` folder contains a generated collection of
[NPM packages](https://npmjs.com/) that can be installed with the Nix package
manager.
As a rule of thumb, the package set should only provide *end user* software
packages, such as command-line utilities. Libraries should only be added to the
package set if there is a non-NPM package that requires it.
When it is desired to use NPM libraries in a development project, use the
`node2nix` generator directly on the `package.json` configuration file of the
project.
The package set provides support for the official stable Node.js versions.
The latest stable LTS release in `nodePackages`, as well as the latest stable
Current release in `nodePackages_latest`.
If your package uses native addons, you need to examine what kind of native
build system it uses. Here are some examples:
* `node-gyp`
* `node-gyp-builder`
* `node-pre-gyp`
After you have identified the correct system, you need to override your package
expression while adding in build system as a build input. For example, `dat`
requires `node-gyp-build`, so [we override](https://github.com/NixOS/nixpkgs/blob/32f5e5da4a1b3f0595527f5195ac3a91451e9b56/pkgs/development/node-packages/default.nix#L37-L40) its expression in [`default.nix`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/node-packages/default.nix):
```nix
dat = super.dat.override {
buildInputs = [ self.node-gyp-build pkgs.libtool pkgs.autoconf pkgs.automake ];
meta.broken = since "12";
};
```
To add a package from NPM to nixpkgs:
1. Modify `pkgs/development/node-packages/node-packages.json` to add, update
or remove package entries to have it included in `nodePackages` and
`nodePackages_latest`.
2. Run the script: `(cd pkgs/development/node-packages && ./generate.sh)`.
3. Build your new package to test your changes:
`cd /path/to/nixpkgs && nix-build -A nodePackages.<new-or-updated-package>`.
To build against the latest stable Current Node.js version (e.g. 14.x):
`nix-build -A nodePackages_latest.<new-or-updated-package>`
4. Add and commit all modified and generated files.
For more information about the generation process, consult the
[README.md](https://github.com/svanderburg/node2nix) file of the `node2nix`
tool.

View File

@@ -4,83 +4,60 @@ OCaml libraries should be installed in `$(out)/lib/ocaml/${ocaml.version}/site-l
Given that most of the OCaml ecosystem is now built with dune, nixpkgs includes a convenience build support function called `buildDunePackage` that will build an OCaml package using dune, OCaml and findlib and any additional dependencies provided as `buildInputs` or `propagatedBuildInputs`.
Here is a simple package example.
- It defines an (optional) attribute `minimalOCamlVersion` that will be used to
throw a descriptive evaluation error if building with an older OCaml is
attempted.
- It uses the `fetchFromGitHub` fetcher to get its source.
- `useDune2 = true` ensures that the latest version of Dune is used for the
build (this may become the default value in a future release).
- It sets the optional `doCheck` attribute such that tests will be run with
`dune runtest -p angstrom` after the build (`dune build -p angstrom`) is
complete, but only if the Ocaml version is at at least `"4.05"`.
- It uses the package `ocaml-syntax-shims` as a build input, `alcotest` and
`ppx_let` as check inputs (because they are needed to run the tests), and
`bigstringaf` and `result` as propagated build inputs (thus they will also be
available to libraries depending on this library).
- The library will be installed using the `angstrom.install` file that dune
generates.
Here is a simple package example. It defines an (optional) attribute `minimumOCamlVersion` that will be used to throw a descriptive evaluation error if building with an older OCaml is attempted. It uses the `fetchFromGitHub` fetcher to get its source. It sets the `doCheck` (optional) attribute to `true` which means that tests will be run with `dune runtest -p angstrom` after the build (`dune build -p angstrom`) is complete. It uses `alcotest` as a build input (because it is needed to run the tests) and `bigstringaf` and `result` as propagated build inputs (thus they will also be available to libraries depending on this library). The library will be installed using the `angstrom.install` file that dune generates.
```nix
{ lib,
fetchFromGitHub,
buildDunePackage,
ocaml,
ocaml-syntax-shims,
alcotest,
result,
bigstringaf,
ppx_let }:
{ lib
, fetchFromGitHub
, buildDunePackage
, alcotest
, result
, bigstringaf
}:
buildDunePackage rec {
pname = "angstrom";
version = "0.15.0";
useDune2 = true;
version = "0.10.0";
minimalOCamlVersion = "4.04";
minimumOCamlVersion = "4.03";
src = fetchFromGitHub {
owner = "inhabitedtype";
repo = pname;
rev = version;
sha256 = "1hmrkdcdlkwy7rxhngf3cv3sa61cznnd9p5lmqhx20664gx2ibrh";
sha256 = "0lh6024yf9ds0nh9i93r9m6p5psi8nvrqxl5x7jwl13zb0r9xfpw";
};
checkInputs = [ alcotest ppx_let ];
buildInputs = [ ocaml-syntax-shims ];
buildInputs = [ alcotest ];
propagatedBuildInputs = [ bigstringaf result ];
doCheck = lib.versionAtLeast ocaml.version "4.05";
doCheck = true;
meta = {
meta = with lib; {
homepage = "https://github.com/inhabitedtype/angstrom";
description = "OCaml parser combinators built for speed and memory efficiency";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ sternenseemann ];
license = licenses.bsd3;
maintainers = with maintainers; [ sternenseemann ];
};
}
```
Here is a second example, this time using a source archive generated with `dune-release`. It is a good idea to use this archive when it is available as it will usually contain substituted variables such as a `%%VERSION%%` field. This library does not depend on any other OCaml library and no tests are run after building it.
```nix
{ lib, fetchurl, buildDunePackage }:
{ lib
, fetchurl
, buildDunePackage
}:
buildDunePackage rec {
pname = "wtf8";
version = "1.0.2";
version = "1.0.1";
useDune2 = true;
minimalOCamlVersion = "4.02";
minimumOCamlVersion = "4.01";
src = fetchurl {
url = "https://github.com/flowtype/ocaml-${pname}/releases/download/v${version}/${pname}-v${version}.tbz";
sha256 = "09ygcxxd5warkdzz17rgpidrd0pg14cy2svvnvy1hna080lzg7vp";
url = "https://github.com/flowtype/ocaml-${pname}/releases/download/v${version}/${pname}-${version}.tbz";
sha256 = "1msg3vycd3k8qqj61sc23qks541cxpb97vrnrvrhjnqxsqnh6ygq";
};
meta = with lib; {

View File

@@ -1,100 +0,0 @@
# Octave {#sec-octave}
## Introduction {#ssec-octave-introduction}
Octave is a modular scientific programming language and environment.
A majority of the packages supported by Octave from their [website](https://octave.sourceforge.io/packages.php) are packaged in nixpkgs.
## Structure {#ssec-octave-structure}
All Octave add-on packages are available in two ways:
1. Under the top-level `Octave` attribute, `octave.pkgs`.
2. As a top-level attribute, `octavePackages`.
## Packaging Octave Packages {#ssec-octave-packaging}
Nixpkgs provides a function `buildOctavePackage`, a generic package builder function for any Octave package that complies with the Octave's current packaging format.
All Octave packages are defined in [pkgs/top-level/octave-packages.nix](https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/octave-packages.nix) rather than `pkgs/all-packages.nix`.
Each package is defined in their own file in the [pkgs/development/octave-modules](https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/octave-modules) directory.
Octave packages are made available through `all-packages.nix` through both the attribute `octavePackages` and `octave.pkgs`.
You can test building an Octave package as follows:
```ShellSession
$ nix-build -A octavePackages.symbolic
```
When building Octave packages with `nix-build`, the `buildOctavePackage` function adds `octave-octaveVersion` to; the start of the package's name attribute.
This can be required when installing the package using `nix-env`:
```ShellSession
$ nix-env -i octave-6.2.0-symbolic
```
Although, you can also install it using the attribute name:
```ShellSession
$ nix-env -i -A octavePackages.symbolic
```
You can build Octave with packages by using the `withPackages` passed-through function.
```ShellSession
$ nix-shell -p 'octave.withPackages (ps: with ps; [ symbolic ])'
```
This will also work in a `shell.nix` file.
```nix
{ pkgs ? import <nixpkgs> { }}:
pkgs.mkShell {
nativeBuildInputs = with pkgs; [
(octave.withPackages (opkgs: with opkgs; [ symbolic ]))
];
}
```
### `buildOctavePackage` Steps {#sssec-buildOctavePackage-steps}
The `buildOctavePackage` does several things to make sure things work properly.
1. Sets the environment variable `OCTAVE_HISTFILE` to `/dev/null` during package compilation so that the commands run through the Octave interpreter directly are not logged.
2. Skips the configuration step, because the packages are stored as gzipped tarballs, which Octave itself handles directly.
3. Change the hierarchy of the tarball so that only a single directory is at the top-most level of the tarball.
4. Use Octave itself to run the `pkg build` command, which unzips the tarball, extracts the necessary files written in Octave, and compiles any code written in C++ or Fortran, and places the fully compiled artifact in `$out`.
`buildOctavePackage` is built on top of `stdenv` in a standard way, allowing most things to be customized.
### Handling Dependencies {#sssec-octave-handling-dependencies}
In Octave packages, there are four sets of dependencies that can be specified:
`nativeBuildInputs`
: Just like other packages, `nativeBuildInputs` is intended for architecture-dependent build-time-only dependencies.
`buildInputs`
: Like other packages, `buildInputs` is intended for architecture-independent build-time-only dependencies.
`propagatedBuildInputs`
: Similar to other packages, `propagatedBuildInputs` is intended for packages that are required for both building and running of the package.
See [Symbolic](https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/octave-modules/symbolic/default.nix) for how this works and why it is needed.
`requiredOctavePackages`
: This is a special dependency that ensures the specified Octave packages are dependent on others, and are made available simultaneously when loading them in Octave.
### Installing Octave Packages {#sssec-installing-octave-packages}
By default, the `buildOctavePackage` function does _not_ install the requested package into Octave for use.
The function will only build the requested package.
This is due to Octave maintaining an text-based database about which packages are installed where.
To this end, when all the requested packages have been built, the Octave package and all its add-on packages are put together into an environment, similar to Python.
1. First, all the Octave binaries are wrapped with the environment variable `OCTAVE_SITE_INITFILE` set to a file in `$out`, which is required for Octave to be able to find the non-standard package database location.
2. Because of the way `buildEnv` works, all tarballs that are present (which should be all Octave packages to install) should be removed.
3. The path down to the default install location of Octave packages is recreated so that Nix-operated Octave can install the packages.
4. Install the packages into the `$out` environment while writing package entries to the database file.
This database file is unique for each different (according to Nix) environment invocation.
5. Rewrite the Octave-wide startup file to read from the list of packages installed in that particular environment.
6. Wrap any programs that are required by the Octave packages so that they work with all the paths defined within the environment.

View File

@@ -122,7 +122,7 @@ ImageExifTool = buildPerlPackage {
};
buildInputs = lib.optional stdenv.isDarwin shortenPerlShebang;
postInstall = lib.optionalString stdenv.isDarwin ''
postInstall = lib.optional stdenv.isDarwin ''
shortenPerlShebang $out/bin/exiftool
'';
};

View File

@@ -1,14 +1,14 @@
# Python {#python}
## User Guide {#user-guide}
## User Guide
### Using Python {#using-python}
### Using Python
#### Overview {#overview}
#### Overview
Several versions of the Python interpreter are available on Nix, as well as a
high amount of packages. The attribute `python3` refers to the default
interpreter, which is currently CPython 3.9. The attribute `python` refers to
interpreter, which is currently CPython 3.8. The attribute `python` refers to
CPython 2.7 for backwards-compatibility. It is also possible to refer to
specific versions, e.g. `python38` refers to CPython 3.8, and `pypy` refers to
the default PyPy interpreter.
@@ -31,7 +31,7 @@ The main package set contains aliases to these package sets, e.g.
`pythonPackages` refers to `python.pkgs` and `python38Packages` to
`python38.pkgs`.
#### Installing Python and packages {#installing-python-and-packages}
#### Installing Python and packages
The Nix and NixOS manuals explain how packages are generally installed. In the
case of Python and Nix, it is important to make a distinction between whether the
@@ -62,7 +62,7 @@ Philosphically, this should be familiar to users who are used to a `venv` style
of development: individual projects create their own Python environments without
impacting the global environment or each other.
#### Ad-hoc temporary Python environment with `nix-shell` {#ad-hoc-temporary-python-environment-with-nix-shell}
#### Ad-hoc temporary Python environment with `nix-shell`
The simplest way to start playing with the way nix wraps and sets up Python
environments is with `nix-shell` at the cmdline. These environments create a
@@ -131,7 +131,7 @@ arbitrary dependencies. This is a good way to get a feel for how the Python
interpreter and dependencies work in Nix and NixOS, but to do some actual
development, we'll want to make it a bit more persistent.
##### Running Python scripts and using `nix-shell` as shebang {#running-python-scripts-and-using-nix-shell-as-shebang}
##### Running Python scripts and using `nix-shell` as shebang
Sometimes, we have a script whose header looks like this:
@@ -146,7 +146,7 @@ print(f"The dot product of {a} and {b} is: {np.dot(a, b)}")
Executing this script requires a `python3` that has `numpy`. Using what we learned
in the previous section, we could startup a shell and just run it like so:
```ShellSession
```ShellSesssion
$ nix-shell -p 'python38.withPackages(ps: with ps; [ numpy ])' --run 'python3 foo.py'
The dot product of [1 2] and [3 4] is: 11
```
@@ -203,7 +203,7 @@ of the package versions.
This is also a great way to ensure the script executes identically on different
servers.
##### Load environment from `.nix` expression {#load-environment-from-.nix-expression}
##### Load environment from `.nix` expression
We've now seen how to create an ad-hoc temporary shell session, and how to
create a single script with Python dependencies, but in the course of normal
@@ -262,7 +262,7 @@ and its Python dependencies, but also tools like `black` or `mypy` and libraries
like `libffi` the `openssl` in scope. This is generic and can span any number of
tools or languages across the Nixpkgs ecosystem.
##### Installing environments globally on the system {#installing-environments-globally-on-the-system}
##### Installing environments globally on the system
Up to now, we've been creating environments scoped to an ad-hoc shell session,
or a single script, or a single project. This is generally advisable, as it
@@ -315,7 +315,7 @@ If you get a conflict or prefer to keep the setup clean, you can have `nix-env`
atomically *uninstall* all other imperatively installed packages and replace
your profile with just `myEnv` by using the `--replace` flag.
##### Environment defined in `/etc/nixos/configuration.nix` {#environment-defined-in-etcnixosconfiguration.nix}
##### Environment defined in `/etc/nixos/configuration.nix`
For the sake of completeness, here's how to install the environment system-wide
on NixOS.
@@ -329,7 +329,7 @@ on NixOS.
}
```
### Developing with Python {#developing-with-python}
### Developing with Python
Above, we were mostly just focused on use cases and what to do to get started
creating working Python environments in nix.
@@ -338,7 +338,7 @@ Now that you know the basics to be up and running, it is time to take a step
back and take a deeper look at how Python packages are packaged on Nix. Then,
we will look at how you can use development mode with your code.
#### Python library packages in Nixpkgs {#python-library-packages-in-nixpkgs}
#### Python library packages in Nixpkgs
With Nix all packages are built by functions. The main function in Nix for
building Python libraries is `buildPythonPackage`. Let's see how we can build the
@@ -425,7 +425,7 @@ of `withPackages` we used a `let` expression. You can see that we used
`toolz` from the Nixpkgs package set this time, but instead took our own version
that we introduced with the `let` expression.
#### Handling dependencies {#handling-dependencies}
#### Handling dependencies
Our example, `toolz`, does not have any dependencies on other Python packages or
system libraries. According to the manual, `buildPythonPackage` uses the
@@ -439,7 +439,7 @@ The following example shows which arguments are given to `buildPythonPackage` in
order to build [`datashape`](https://github.com/blaze/datashape).
```nix
{ lib, buildPythonPackage, fetchPypi, numpy, multipledispatch, python-dateutil, pytest }:
{ lib, buildPythonPackage, fetchPypi, numpy, multipledispatch, dateutil, pytest }:
buildPythonPackage rec {
pname = "datashape";
@@ -451,7 +451,7 @@ buildPythonPackage rec {
};
checkInputs = [ pytest ];
propagatedBuildInputs = [ numpy multipledispatch python-dateutil ];
propagatedBuildInputs = [ numpy multipledispatch dateutil ];
meta = with lib; {
homepage = "https://github.com/ContinuumIO/datashape";
@@ -463,7 +463,7 @@ buildPythonPackage rec {
```
We can see several runtime dependencies, `numpy`, `multipledispatch`, and
`python-dateutil`. Furthermore, we have one `checkInputs`, i.e. `pytest`. `pytest` is a
`dateutil`. Furthermore, we have one `checkInputs`, i.e. `pytest`. `pytest` is a
test runner and is only used during the `checkPhase` and is therefore not added
to `propagatedBuildInputs`.
@@ -537,10 +537,9 @@ buildPythonPackage rec {
};
}
```
Note also the line `doCheck = false;`, we explicitly disabled running the test-suite.
#### Testing Python Packages {#testing-python-packages}
#### Testing Python Packages
It is highly encouraged to have testing as part of the package build. This
helps to avoid situations where the package was able to build and install,
@@ -560,11 +559,10 @@ thus can cause issues when a test suite asserts on that behavior.
as many tests should be enabled as possible. Failing tests can still be
a good indication that the package is not in a valid state.
#### Using pytest {#using-pytest}
#### Using pytest
Pytest is the most common test runner for python repositories. A trivial
test run would be:
```
checkInputs = [ pytest ];
checkPhase = "pytest";
@@ -574,7 +572,6 @@ However, many repositories' test suites do not translate well to nix's build
sandbox, and will generally need many tests to be disabled.
To filter tests using pytest, one can do the following:
```
checkInputs = [ pytest ];
# avoid tests which need additional data or touch network
@@ -590,20 +587,19 @@ easier than having to create a new package.
`-k` is used to define a predicate for test names. In this example, we are
filtering out tests which contain `download` or `update` in their test case name.
Only one `-k` argument is allowed, and thus a long predicate should be concatenated
with “\\” and wrapped to the next line.
Only one `-k` argument is allows, and thus a long predicate should be concatenated
with "\" and wrapped to the next line.
*NOTE:* In pytest==6.0.1, the use of “\\” to continue a line (e.g. `-k 'not download \'`) has
*NOTE:* In pytest==6.0.1, the use of "\" to continue a line (e.g. `-k 'not download \'`) has
been removed, in this case, it's recommended to use `pytestCheckHook`.
#### Using pytestCheckHook {#using-pytestcheckhook}
#### Using pytestCheckHook
`pytestCheckHook` is a convenient hook which will substitute the setuptools
`test` command for a checkPhase which runs `pytest`. This is also beneficial
when a package may need many items disabled to run the test suite.
Using the example above, the analagous pytestCheckHook usage would be:
```
checkInputs = [ pytestCheckHook ];
@@ -641,7 +637,7 @@ Trying to concatenate the related strings to disable tests in a regular checkPha
would be much harder to read. This also enables us to comment on why specific tests
are disabled.
#### Using pythonImportsCheck {#using-pythonimportscheck}
#### Using pythonImportsCheck
Although unit tests are highly prefered to validate correctness of a package, not
all packages have test suites that can be ran easily, and some have none at all.
@@ -663,7 +659,7 @@ However, this is done in it's own phase, and not dependent on whether `doCheck =
This can also be useful in verifying that the package doesn't assume commonly
present packages (e.g. `setuptools`)
### Develop local package {#develop-local-package}
### Develop local package
As a Python developer you're likely aware of [development mode](http://setuptools.readthedocs.io/en/latest/setuptools.html#development-mode)
(`python setup.py develop`); instead of installing the package this command
@@ -698,7 +694,7 @@ buildPythonPackage rec {
It is important to note that due to how development mode is implemented on Nix
it is not possible to have multiple packages simultaneously in development mode.
### Organising your packages {#organising-your-packages}
### Organising your packages
So far we discussed how you can use Python on Nix, and how you can develop with
it. We've looked at how you write expressions to package Python packages, and we
@@ -710,7 +706,7 @@ like to be able to use in different projects. In order to minimise unnecessary
duplication we now look at how you can maintain a repository with your
own packages. The important functions here are `import` and `callPackage`.
### Including a derivation using `callPackage` {#including-a-derivation-using-callpackage}
### Including a derivation using `callPackage`
Earlier we created a Python environment using `withPackages`, and included the
`toolz` package via a `let` expression.
@@ -760,12 +756,12 @@ don't explicitly define which `python` derivation should be used. In the above
example we use `buildPythonPackage` that is part of the set `python38Packages`,
and in this case the `python38` interpreter is automatically used.
## Reference {#reference}
## Reference
### Interpreters {#interpreters}
### Interpreters
Versions 2.7, 3.6, 3.7, 3.8 and 3.9 of the CPython interpreter are available as
respectively `python27`, `python37`, `python38` and `python39`. The
respectively `python27`, `python36`, `python37`, `python38` and `python39`. The
aliases `python2` and `python3` correspond to respectively `python27` and
`python39`. The attribute `python` maps to `python2`. The PyPy interpreters
compatible with Python 2.7 and 3 are available as `pypy27` and `pypy3`, with
@@ -777,11 +773,11 @@ All packages depending on any Python interpreter get appended
`out/{python.sitePackages}` to `$PYTHONPATH` if such directory
exists.
#### Missing `tkinter` module standard library {#missing-tkinter-module-standard-library}
#### Missing `tkinter` module standard library
To reduce closure size the `Tkinter`/`tkinter` is available as a separate package, `pythonPackages.tkinter`.
#### Attributes on interpreters packages {#attributes-on-interpreters-packages}
#### Attributes on interpreters packages
Each interpreter has the following attributes:
@@ -793,7 +789,7 @@ Each interpreter has the following attributes:
- `executable`. Name of the interpreter executable, e.g. `python3.8`.
- `pkgs`. Set of Python packages for that specific interpreter. The package set can be modified by overriding the interpreter and passing `packageOverrides`.
### Optimizations {#optimizations}
### Optimizations
The Python interpreters are by default not build with optimizations enabled, because
the builds are in that case not reproducible. To enable optimizations, override the
@@ -810,7 +806,7 @@ let
in mypython
```
### Building packages and applications {#building-packages-and-applications}
### Building packages and applications
Python libraries and applications that use `setuptools` or
`distutils` are typically built with respectively the `buildPythonPackage` and
@@ -830,19 +826,19 @@ attribute set is created for each available Python interpreter. The available
sets are
* `pkgs.python27Packages`
* `pkgs.python36Packages`
* `pkgs.python37Packages`
* `pkgs.python38Packages`
* `pkgs.python39Packages`
* `pkgs.python310Packages`
* `pkgs.pypyPackages`
and the aliases
* `pkgs.python2Packages` pointing to `pkgs.python27Packages`
* `pkgs.python3Packages` pointing to `pkgs.python39Packages`
* `pkgs.python3Packages` pointing to `pkgs.python38Packages`
* `pkgs.pythonPackages` pointing to `pkgs.python2Packages`
#### `buildPythonPackage` function {#buildpythonpackage-function}
#### `buildPythonPackage` function
The `buildPythonPackage` function is implemented in
`pkgs/development/interpreters/python/mk-python-derivation`
@@ -851,7 +847,7 @@ using setup hooks.
The following is an example:
```nix
{ lib, buildPythonPackage, fetchPypi, hypothesis, setuptools-scm, attrs, py, setuptools, six, pluggy }:
{ lib, buildPythonPackage, fetchPypi, hypothesis, setuptools_scm, attrs, py, setuptools, six, pluggy }:
buildPythonPackage rec {
pname = "pytest";
@@ -868,7 +864,7 @@ buildPythonPackage rec {
'';
checkInputs = [ hypothesis ];
nativeBuildInputs = [ setuptools-scm ];
nativeBuildInputs = [ setuptools_scm ];
propagatedBuildInputs = [ attrs py setuptools six pluggy ];
meta = with lib; {
@@ -894,7 +890,7 @@ e.g. the test runner, should be added to `checkInputs`.
By default `meta.platforms` is set to the same value
as the interpreter unless overridden otherwise.
##### `buildPythonPackage` parameters {#buildpythonpackage-parameters}
##### `buildPythonPackage` parameters
All parameters from `stdenv.mkDerivation` function are still supported. The
following are specific to `buildPythonPackage`:
@@ -950,7 +946,7 @@ because their behaviour is different:
`buildPythonPackage` also injects code into and wraps executables with the
paths included in this list. Items listed in `install_requires` go here.
##### Overriding Python packages {#overriding-python-packages}
##### Overriding Python packages
The `buildPythonPackage` function has a `overridePythonAttrs` method that can be
used to override the package. In the following example we create an environment
@@ -978,7 +974,7 @@ with import <nixpkgs> {};
in python.withPackages(ps: [ps.blaze])).env
```
#### `buildPythonApplication` function {#buildpythonapplication-function}
#### `buildPythonApplication` function
The `buildPythonApplication` function is practically the same as
`buildPythonPackage`. The main purpose of this function is to build a Python
@@ -1023,7 +1019,7 @@ luigi = callPackage ../applications/networking/cluster/luigi { };
Since the package is an application, a consumer doesn't need to care about
Python versions or modules, which is why they don't go in `pythonPackages`.
#### `toPythonApplication` function {#topythonapplication-function}
#### `toPythonApplication` function
A distinction is made between applications and libraries, however, sometimes a
package is used as both. In this case the package is added as a library to
@@ -1035,12 +1031,11 @@ The Nix expression shall use `buildPythonPackage` and be called from
`python-packages.nix`. A reference shall be created from `all-packages.nix` to
the attribute in `python-packages.nix`, and the `toPythonApplication` shall be
applied to the reference:
```nix
youtube-dl = with pythonPackages; toPythonApplication youtube-dl;
```
#### `toPythonModule` function {#topythonmodule-function}
#### `toPythonModule` function
In some cases, such as bindings, a package is created using
`stdenv.mkDerivation` and added as attribute in `all-packages.nix`. The Python
@@ -1057,7 +1052,7 @@ opencv = toPythonModule (pkgs.opencv.override {
Do pay attention to passing in the right Python version!
#### `python.buildEnv` function {#python.buildenv-function}
#### `python.buildEnv` function
Python environments can be created using the low-level `pkgs.buildEnv` function.
This example shows how to create an environment that has the Pyramid Web Framework.
@@ -1095,8 +1090,8 @@ with import <nixpkgs> {};
will drop you into a shell where Python will have the
specified packages in its path.
##### `python.buildEnv` arguments {#python.buildenv-arguments}
##### `python.buildEnv` arguments
* `extraLibs`: List of packages installed inside the environment.
* `postBuild`: Shell command executed after the build of environment.
@@ -1104,7 +1099,7 @@ specified packages in its path.
* `permitUserSite`: Skip setting the `PYTHONNOUSERSITE` environment variable in
wrapped binaries in the environment.
#### `python.withPackages` function {#python.withpackages-function}
#### `python.withPackages` function
The `python.withPackages` function provides a simpler interface to the `python.buildEnv` functionality.
It takes a function as an argument that is passed the set of python packages and returns the list
@@ -1146,7 +1141,7 @@ need them, you have to use `python.buildEnv`.
Python 2 namespace packages may provide `__init__.py` that collide. In that case
`python.buildEnv` should be used with `ignoreCollisions = true`.
#### Setup hooks {#setup-hooks}
#### Setup hooks
The following are setup hooks specifically for Python packages. Most of these
are used in `buildPythonPackage`.
@@ -1171,7 +1166,7 @@ are used in `buildPythonPackage`.
- `wheelUnpackHook` to move a wheel to the correct folder so it can be installed
with the `pipInstallHook`.
### Development mode {#development-mode}
### Development mode
Development or editable mode is supported. To develop Python packages
`buildPythonPackage` has additional logic inside `shellPhase` to run `pip
@@ -1180,7 +1175,6 @@ install -e . --prefix $TMPDIR/`for the package.
Warning: `shellPhase` is executed only if `setup.py` exists.
Given a `default.nix`:
```nix
with import <nixpkgs> {};
@@ -1203,7 +1197,7 @@ nix-shell -p pythonPackages.pyramid zlib libjpeg git
Note: There is a boolean value `lib.inNixShell` set to `true` if nix-shell is invoked.
### Tools {#tools}
### Tools
Packages inside nixpkgs are written by hand. However many tools exist in
community to help save time. No tool is preferred at the moment.
@@ -1215,7 +1209,7 @@ community to help save time. No tool is preferred at the moment.
- [nixpkgs-pytools](https://github.com/nix-community/nixpkgs-pytools)
- [poetry2nix](https://github.com/nix-community/poetry2nix)
### Deterministic builds {#deterministic-builds}
### Deterministic builds
The Python interpreters are now built deterministically. Minor modifications had
to be made to the interpreters in order to generate deterministic bytecode. This
@@ -1227,7 +1221,7 @@ have timestamp 1. The `buildPythonPackage` function sets `DETERMINISTIC_BUILD=1`
and [PYTHONHASHSEED=0](https://docs.python.org/3.8/using/cmdline.html#envvar-PYTHONHASHSEED).
Both are also exported in `nix-shell`.
### Automatic tests {#automatic-tests}
### Automatic tests
It is recommended to test packages as part of the build process.
Source distributions (`sdist`) often include test files, but not always.
@@ -1236,7 +1230,7 @@ By default the command `python setup.py test` is run as part of the
`checkPhase`, but often it is necessary to pass a custom `checkPhase`. An
example of such a situation is when `py.test` is used.
#### Common issues {#common-issues}
#### Common issues
* Non-working tests can often be deselected. By default `buildPythonPackage`
runs `python setup.py test`. Most Python modules follows the standard test
@@ -1253,19 +1247,18 @@ example of such a situation is when `py.test` is used.
'';
}
```
* Tests that attempt to access `$HOME` can be fixed by using the following
work-around before running tests (e.g. `preCheck`): `export HOME=$(mktemp -d)`
## FAQ {#faq}
## FAQ
### How to solve circular dependencies? {#how-to-solve-circular-dependencies}
### How to solve circular dependencies?
Consider the packages `A` and `B` that depend on each other. When packaging `B`,
a solution is to override package `A` not to depend on `B` as an input. The same
should also be done when packaging `A`.
### How to override a Python package? {#how-to-override-a-python-package}
### How to override a Python package?
We can override the interpreter and pass `packageOverrides`. In the following
example we rename the `pandas` package and build it.
@@ -1323,7 +1316,7 @@ let
in newpkgs.inkscape
```
### `python setup.py bdist_wheel` cannot create .whl {#python-setup.py-bdist_wheel-cannot-create-.whl}
### `python setup.py bdist_wheel` cannot create .whl
Executing `python setup.py bdist_wheel` in a `nix-shell `fails with
```
@@ -1356,7 +1349,7 @@ or unset `SOURCE_DATE_EPOCH`:
nix-shell --run "unset SOURCE_DATE_EPOCH; python3 setup.py bdist_wheel"
```
### `install_data` / `data_files` problems {#install_data-data_files-problems}
### `install_data` / `data_files` problems
If you get the following error:
@@ -1376,7 +1369,7 @@ ${python.interpreter} setup.py install_data --install-dir=$out --root=$out
sed -i '/ = data\_files/d' setup.py
```
### Rationale of non-existent global site-packages {#rationale-of-non-existent-global-site-packages}
### Rationale of non-existent global site-packages
On most operating systems a global `site-packages` is maintained. This however
becomes problematic if you want to run multiple Python versions or have multiple
@@ -1391,7 +1384,7 @@ If you want to create a Python environment for development, then the recommended
method is to use `nix-shell`, either with or without the `python.buildEnv`
function.
### How to consume Python modules using pip in a virtual environment like I am used to on other Operating Systems? {#how-to-consume-python-modules-using-pip-in-a-virtual-environment-like-i-am-used-to-on-other-operating-systems}
### How to consume Python modules using pip in a virtual environment like I am used to on other Operating Systems?
While this approach is not very idiomatic from Nix perspective, it can still be
useful when dealing with pre-existing projects or in situations where it's not
@@ -1504,7 +1497,7 @@ is executed it will attempt to download the Python modules listed in
requirements.txt. However these will be cached locally within the `virtualenv`
folder and not downloaded again.
### How to override a Python package from `configuration.nix`? {#how-to-override-a-python-package-from-configuration.nix}
### How to override a Python package from `configuration.nix`?
If you need to change a package's attribute(s) from `configuration.nix` you could do:
@@ -1513,7 +1506,7 @@ If you need to change a package's attribute(s) from `configuration.nix` you coul
python = super.python.override {
packageOverrides = python-self: python-super: {
twisted = python-super.twisted.overrideAttrs (oldAttrs: {
src = super.fetchPypi {
src = super.fetchPipy {
pname = "twisted";
version = "19.10.0";
sha256 = "7394ba7f272ae722a74f3d969dcf599bc4ef093bc392038748a490f1724a515d";
@@ -1542,7 +1535,7 @@ this snippet:
}
```
### How to override a Python package using overlays? {#how-to-override-a-python-package-using-overlays}
### How to override a Python package using overlays?
Use the following overlay template:
@@ -1563,12 +1556,12 @@ self: super: {
}
```
### How to use Intels MKL with numpy and scipy? {#how-to-use-intels-mkl-with-numpy-and-scipy}
### How to use Intel's MKL with numpy and scipy?
MKL can be configured using an overlay. See the section "[Using overlays to
configure alternatives](#sec-overlays-alternatives-blas-lapack)".
### What inputs do `setup_requires`, `install_requires` and `tests_require` map to? {#what-inputs-do-setup_requires-install_requires-and-tests_require-map-to}
### What inputs do `setup_requires`, `install_requires` and `tests_require` map to?
In a `setup.py` or `setup.cfg` it is common to declare dependencies:
@@ -1576,9 +1569,9 @@ In a `setup.py` or `setup.cfg` it is common to declare dependencies:
* `install_requires` corresponds to `propagatedBuildInputs`
* `tests_require` corresponds to `checkInputs`
## Contributing {#contributing}
## Contributing
### Contributing guidelines {#contributing-guidelines}
### Contributing guidelines
The following rules are desired to be respected:
@@ -1602,33 +1595,3 @@ The following rules are desired to be respected:
If necessary, `pname` has to be given a different value within `fetchPypi`.
* Attribute names in `python-packages.nix` should be sorted alphanumerically to
avoid merge conflicts and ease locating attributes.
## Package set maintenance
The whole Python package set has a lot of packages that do not see regular
updates, because they either are a very fragile component in the Python
ecosystem, like for example the `hypothesis` package, or packages that have
no maintainer, so maintenance falls back to the package set maintainers.
### Updating packages in bulk
There is a tool to update alot of python libraries in bulk, it exists at
`maintainers/scripts/update-python-libraries` with this repository.
It can quickly update minor or major versions for all packages selected
and create update commits, and supports the `fetchPypi`, `fetchurl` and
`fetchFromGitHub` fetchers. When updating lots of packages that are
hosted on GitHub, exporting a `GITHUB_API_TOKEN` is highly recommended.
Updating packages in bulk leads to lots of breakages, which is why a
stabilization period on the `python-unstable` branch is required.
Once the branch is sufficiently stable it should normally be merged
into the `staging` branch.
An exemplary call to update all python libraries between minor versions
would be:
```ShellSession
$ maintainers/scripts/update-python-libraries --target minor --commit --use-pkgs-prefix pkgs/development/python-modules/**/default.nix
```

View File

@@ -90,21 +90,19 @@ stdenv.mkDerivation {
}
```
::: {.note}
::: note
`wrapQtAppsHook` ignores files that are non-ELF executables.
This means that scripts won't be automatically wrapped so you'll need to manually wrap them as previously mentioned.
An example of when you'd always need to do this is with Python applications that use PyQt.
:::
## Adding a library to Nixpkgs {#adding-a-library-to-nixpkgs}
## Adding a library to Nixpkgs
Add Qt libraries to `qt5-packages.nix` to make them available for every
supported Qt version.
### Example adding a Qt library {#qt-library-all-packages-nix}
The following represents the contents of `qt5-packages.nix`.
```nix
{
# ...
@@ -128,15 +126,13 @@ stdenv.mkDerivation {
}
```
## Adding an application to Nixpkgs {#adding-an-application-to-nixpkgs}
## Adding an application to Nixpkgs
Add Qt applications to `qt5-packages.nix`. Add an alias to `all-packages.nix`
to select the Qt 5 version used for the application.
### Example adding a Qt application {#qt-application-all-packages-nix}
The following represents the contents of `qt5-packages.nix`.
```nix
{
# ...
@@ -148,7 +144,6 @@ The following represents the contents of `qt5-packages.nix`.
```
The following represents the contents of `all-packages.nix`.
```nix
{
# ...

View File

@@ -1,6 +1,6 @@
# R {#r}
## Installation {#installation}
## Installation
Define an environment for R that contains all the libraries that you'd like to
use by adding the following snippet to your $HOME/.config/nixpkgs/config.nix file:
@@ -31,7 +31,6 @@ output is the name that has to be passed to rWrapper in the code snipped above.
However, if you'd like to add a file to your project source to make the
environment available for other contributors, you can create a `default.nix`
file like so:
```nix
with import <nixpkgs> {};
{
@@ -51,7 +50,7 @@ with import <nixpkgs> {};
and then run `nix-shell .` to be dropped into a shell with those packages
available.
## RStudio {#rstudio}
## RStudio
RStudio uses a standard set of packages and ignores any custom R
environments or installed packages you may have. To create a custom
@@ -94,12 +93,7 @@ Executing `nix-shell` will then drop you into an environment equivalent to the
one above. If you need additional packages just add them to the list and
re-enter the shell.
## Updating the package set {#updating-the-package-set}
There is a script and associated environment for regenerating the package
sets and synchronising the rPackages tree to the current CRAN and matching
BIOC release. These scripts are found in the `pkgs/development/r-modules`
directory and executed as follows:
## Updating the package set
```bash
nix-shell generate-shell.nix
@@ -117,11 +111,13 @@ Rscript generate-r-packages.R bioc-experiment > bioc-experiment-packages.nix.new
mv bioc-experiment-packages.nix.new bioc-experiment-packages.nix
```
`generate-r-packages.R <repo>` reads `<repo>-packages.nix`, therefore
the renaming.
`generate-r-packages.R <repo>` reads `<repo>-packages.nix`, therefor the renaming.
Some packages require overrides to specify external dependencies or other
patches and special requirements. These overrides are specified in the
`pkgs/development/r-modules/default.nix` file. As the `*-packages.nix`
contents are automatically generated it should not be edited and broken
builds should be addressed using overrides.
## Testing if the Nix-expression could be evaluated
```bash
nix-build test-evaluation.nix --dry-run
```
If this exits fine, the expression is ok. If not, you have to edit `default.nix`

View File

@@ -1,6 +1,6 @@
# Ruby {#sec-language-ruby}
## Using Ruby {#using-ruby}
## Using Ruby
Several versions of Ruby interpreters are available on Nix, as well as over 250 gems and many applications written in Ruby. The attribute `ruby` refers to the default Ruby interpreter, which is currently MRI 2.6. It's also possible to refer to specific versions, e.g. `ruby_2_y`, `jruby`, or `mruby`.
@@ -8,11 +8,11 @@ In the Nixpkgs tree, Ruby packages can be found throughout, depending on what th
There are two main approaches for using Ruby with gems. One is to use a specifically locked `Gemfile` for an application that has very strict dependencies. The other is to depend on the common gems, which we'll explain further down, and rely on them being updated regularly.
The interpreters have common attributes, namely `gems`, and `withPackages`. So you can refer to `ruby.gems.nokogiri`, or `ruby_2_7.gems.nokogiri` to get the Nokogiri gem already compiled and ready to use.
The interpreters have common attributes, namely `gems`, and `withPackages`. So you can refer to `ruby.gems.nokogiri`, or `ruby_2_6.gems.nokogiri` to get the Nokogiri gem already compiled and ready to use.
Since not all gems have executables like `nokogiri`, it's usually more convenient to use the `withPackages` function like this: `ruby.withPackages (p: with p; [ nokogiri ])`. This will also make sure that the Ruby in your environment will be able to find the gem and it can be used in your Ruby code (for example via `ruby` or `irb` executables) via `require "nokogiri"` as usual.
### Temporary Ruby environment with `nix-shell` {#temporary-ruby-environment-with-nix-shell}
### Temporary Ruby environment with `nix-shell`
Rather than having a single Ruby environment shared by all Ruby development projects on a system, Nix allows you to create separate environments per project. `nix-shell` gives you the possibility to temporarily load another environment akin to a combined `chruby` or `rvm` and `bundle exec`.
@@ -30,7 +30,7 @@ $ nix-shell -p ruby.gems.nokogiri ruby.gems.pry
Again, it's possible to launch the interpreter from the shell. The Ruby interpreter has the attribute `gems` which contains all Ruby gems for that specific interpreter.
#### Load Ruby environment from `.nix` expression {#load-ruby-environment-from-.nix-expression}
#### Load Ruby environment from `.nix` expression
As explained in the Nix manual, `nix-shell` can also load an expression from a `.nix` file. Say we want to have Ruby 2.6, `nokogori`, and `pry`. Consider a `shell.nix` file with:
@@ -45,7 +45,7 @@ What's happening here?
2. Then we create a Ruby environment with the `withPackages` function.
3. The `withPackages` function expects us to provide a function as an argument that takes the set of all ruby gems and returns a list of packages to include in the environment. Here, we select the packages `nokogiri` and `pry` from the package set.
#### Execute command with `--run` {#execute-command-with---run}
#### Execute command with `--run`
A convenient flag for `nix-shell` is `--run`. It executes a command in the `nix-shell`. We can e.g. directly open a `pry` REPL:
@@ -65,7 +65,7 @@ Or run a script using this environment:
$ nix-shell -p "ruby.withPackages (ps: with ps; [ nokogiri pry ])" --run "ruby example.rb"
```
#### Using `nix-shell` as shebang {#using-nix-shell-as-shebang}
#### Using `nix-shell` as shebang
In fact, for the last case, there is a more convenient method. You can add a [shebang](<https://en.wikipedia.org/wiki/Shebang_(Unix)>) to your script specifying which dependencies `nix-shell` needs. With the following shebang, you can just execute `./example.rb`, and it will run with all dependencies.
@@ -80,9 +80,9 @@ body = RestClient.get('http://example.com').body
puts Nokogiri::HTML(body).at('h1').text
```
## Developing with Ruby {#developing-with-ruby}
## Developing with Ruby
### Using an existing Gemfile {#using-an-existing-gemfile}
### Using an existing Gemfile
In most cases, you'll already have a `Gemfile.lock` listing all your dependencies. This can be used to generate a `gemset.nix` which is used to fetch the gems and combine them into a single environment. The reason why you need to have a separate file for this, is that Nix requires you to have a checksum for each input to your build. Since the `Gemfile.lock` that `bundler` generates doesn't provide us with checksums, we have to first download each gem, calculate its SHA256, and store it in this separate file.
@@ -120,7 +120,7 @@ One common issue that you might have is that you have Ruby 2.6, but also `bundle
mkShell { buildInputs = [ gems (lowPrio gems.wrappedRuby) ]; }
```
### Gem-specific configurations and workarounds {#gem-specific-configurations-and-workarounds}
### Gem-specific configurations and workarounds
In some cases, especially if the gem has native extensions, you might need to modify the way the gem is built.
@@ -201,7 +201,7 @@ $ nix-shell --run 'ruby -rpg -e "puts PG.library_version"'
Of course for this use-case one could also use overlays since the configuration for `pg` depends on the `postgresql` alias, but for demonstration purposes this has to suffice.
### Adding a gem to the default gemset {#adding-a-gem-to-the-default-gemset}
### Adding a gem to the default gemset
Now that you know how to get a working Ruby environment with Nix, it's time to go forward and start actually developing with Ruby. We will first have a look at how Ruby gems are packaged on Nix. Then, we will look at how you can use development mode with your code.
@@ -215,7 +215,7 @@ To test that it works, you can then try using the gem with:
NIX_PATH=nixpkgs=$PWD nix-shell -p "ruby.withPackages (ps: with ps; [ name-of-your-gem ])"
```
### Packaging applications {#packaging-applications}
### Packaging applications
A common task is to add a ruby executable to nixpkgs, popular examples would be `chef`, `jekyll`, or `sass`. A good way to do that is to use the `bundlerApp` function, that allows you to make a package that only exposes the listed executables, otherwise the package may cause conflicts through common paths like `bin/rake` or `bin/bundler` that aren't meant to be used.
@@ -243,7 +243,7 @@ bundlerApp {
All that's left to do is to generate the corresponding `Gemfile.lock` and `gemset.nix` as described above in the `Using an existing Gemfile` section.
#### Packaging executables that require wrapping {#packaging-executables-that-require-wrapping}
#### Packaging executables that require wrapping
Sometimes your app will depend on other executables at runtime, and tries to find it through the `PATH` environment variable.

View File

@@ -13,14 +13,14 @@ into your `configuration.nix` or bring them into scope with `nix-shell -p rustc
For other versions such as daily builds (beta and nightly),
use either `rustup` from nixpkgs (which will manage the rust installation in your home directory),
or use a community maintained [Rust overlay](#using-community-rust-overlays).
or use Mozilla's [Rust nightlies overlay](#using-the-rust-nightlies-overlay).
## Compiling Rust applications with Cargo {#compiling-rust-applications-with-cargo}
## Compiling Rust applications with Cargo
Rust applications are packaged by using the `buildRustPackage` helper from `rustPlatform`:
```nix
{ lib, fetchFromGitHub, rustPlatform }:
{ lib, rustPlatform }:
rustPlatform.buildRustPackage rec {
pname = "ripgrep";
@@ -107,113 +107,8 @@ rustPlatform.buildRustPackage rec {
}
```
### Importing a `Cargo.lock` file {#importing-a-cargo.lock-file}
Using `cargoSha256` or `cargoHash` is tedious when using
`buildRustPackage` within a project, since it requires that the hash
is updated after every change to `Cargo.lock`. Therefore,
`buildRustPackage` also supports vendoring dependencies directly from
a `Cargo.lock` file using the `cargoLock` argument. For example:
```nix
rustPlatform.buildRustPackage {
pname = "myproject";
version = "1.0.0";
cargoLock = {
lockFile = ./Cargo.lock;
};
# ...
}
```
This will retrieve the dependencies using fixed-output derivations from
the specified lockfile.
One caveat is that `Cargo.lock` cannot be patched in the `patchPhase`
because it runs after the dependencies have already been fetched. If
you need to patch or generate the lockfile you can alternatively set
`cargoLock.lockFileContents` to a string of its contents:
```nix
rustPlatform.buildRustPackage {
pname = "myproject";
version = "1.0.0";
cargoLock = let
fixupLockFile = path: f (builtins.readFile path);
in {
lockFileContents = fixupLockFile ./Cargo.lock;
};
# ...
}
```
Note that setting `cargoLock.lockFile` or `cargoLock.lockFileContents`
doesn't add a `Cargo.lock` to your `src`, and a `Cargo.lock` is still
required to build a rust package. A simple fix is to use:
```nix
postPatch = ''
cp ${./Cargo.lock} Cargo.lock
'';
```
The output hash of each dependency that uses a git source must be
specified in the `outputHashes` attribute. For example:
```nix
rustPlatform.buildRustPackage rec {
pname = "myproject";
version = "1.0.0";
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"finalfusion-0.14.0" = "17f4bsdzpcshwh74w5z119xjy2if6l2wgyjy56v621skr2r8y904";
};
};
# ...
}
```
If you do not specify an output hash for a git dependency, building
the package will fail and inform you of which crate needs to be
added. To find the correct hash, you can first use `lib.fakeSha256` or
`lib.fakeHash` as a stub hash. Building the package (and thus the
vendored dependencies) will then inform you of the correct hash.
### Cargo features {#cargo-features}
You can disable default features using `buildNoDefaultFeatures`, and
extra features can be added with `buildFeatures`.
If you want to use different features for check phase, you can use
`checkNoDefaultFeatures` and `checkFeatures`. They are only passed to
`cargo test` and not `cargo build`. If left unset, they default to
`buildNoDefaultFeatures` and `buildFeatures`.
For example:
```nix
rustPlatform.buildRustPackage rec {
pname = "myproject";
version = "1.0.0";
buildNoDefaultFeatures = true;
buildFeatures = [ "color" "net" ];
# disable network features in tests
checkFeatures = [ "color" ];
# ...
}
```
### Cross compilation {#cross-compilation}
### Cross compilation
By default, Rust packages are compiled for the host platform, just like any
other package is. The `--target` passed to rust tools is computed from this.
@@ -225,7 +120,6 @@ where they are known to differ. But there are ways to customize the argument:
name will be used instead.
For example:
```nix
import <nixpkgs> {
crossSystem = (import <nixpkgs/lib>).systems.examples.armhf-embedded // {
@@ -233,9 +127,7 @@ where they are known to differ. But there are ways to customize the argument:
};
}
```
will result in:
```shell
--target thumbv7em-none-eabi
```
@@ -248,7 +140,6 @@ where they are known to differ. But there are ways to customize the argument:
will be used instead.
For example:
```nix
import <nixpkgs> {
crossSystem = (import <nixpkgs/lib>).systems.examples.armhf-embedded // {
@@ -257,17 +148,31 @@ where they are known to differ. But there are ways to customize the argument:
};
}
```
will result in:
```shell
--target /nix/store/asdfasdfsadf-thumb-crazy.json # contains {"foo":"","bar":""}
```
Finally, as an ad-hoc escape hatch, a computed target (string or JSON file
path) can be passed directly to `buildRustPackage`:
```nix
pkgs.rustPlatform.buildRustPackage {
/* ... */
target = "x86_64-fortanix-unknown-sgx";
}
```
This is useful to avoid rebuilding Rust tools, since they are actually target
agnostic and don't need to be rebuilt. But in the future, we should always
build the Rust tools and standard library crates separately so there is no
reason not to take the `stdenv.hostPlatform.rustc`-modifying approach, and the
ad-hoc escape hatch to `buildRustPackage` can be removed.
Note that currently custom targets aren't compiled with `std`, so `cargo test`
will fail. This can be ignored by adding `doCheck = false;` to your derivation.
### Running package tests {#running-package-tests}
### Running package tests
When using `buildRustPackage`, the `checkPhase` is enabled by default and runs
`cargo test` on the package to build. To make sure that we don't compile the
@@ -288,14 +193,14 @@ rustPlatform.buildRustPackage {
Please note that the code will be compiled twice here: once in `release` mode
for the `buildPhase`, and again in `debug` mode for the `checkPhase`.
Test flags, e.g., `--package foo`, can be passed to `cargo test` via the
Test flags, e.g., `--features xxx/yyy`, can be passed to `cargo test` via the
`cargoTestFlags` attribute.
Another attribute, called `checkFlags`, is used to pass arguments to the test
binary itself, as stated
(here)[https://doc.rust-lang.org/cargo/commands/cargo-test.html].
#### Tests relying on the structure of the `target/` directory {#tests-relying-on-the-structure-of-the-target-directory}
#### Tests relying on the structure of the `target/` directory
Some tests may rely on the structure of the `target/` directory. Those tests
are likely to fail because we use `cargo --target` during the build. This means that
@@ -305,7 +210,7 @@ rather than in `target/release/`.
This can only be worked around by patching the affected tests accordingly.
#### Disabling package-tests {#disabling-package-tests}
#### Disabling package-tests
In some instances, it may be necessary to disable testing altogether (with `doCheck = false;`):
@@ -319,7 +224,7 @@ The above are just guidelines, and exceptions may be granted on a case-by-case b
However, please check if it's possible to disable a problematic subset of the
test suite and leave a comment explaining your reasoning.
#### Setting `test-threads` {#setting-test-threads}
#### Setting `test-threads`
`buildRustPackage` will use parallel test threads by default,
sometimes it may be necessary to disable this so the tests run consecutively.
@@ -331,7 +236,7 @@ rustPlatform.buildRustPackage {
}
```
### Building a package in `debug` mode {#building-a-package-in-debug-mode}
### Building a package in `debug` mode
By default, `buildRustPackage` will use `release` mode for builds. If a package
should be built in `debug` mode, it can be configured like so:
@@ -345,14 +250,14 @@ rustPlatform.buildRustPackage {
In this scenario, the `checkPhase` will be ran in `debug` mode as well.
### Custom `build`/`install`-procedures {#custom-buildinstall-procedures}
### Custom `build`/`install`-procedures
Some packages may use custom scripts for building/installing, e.g. with a `Makefile`.
In these cases, it's recommended to override the `buildPhase`/`installPhase`/`checkPhase`.
Otherwise, some steps may fail because of the modified directory structure of `target/`.
### Building a crate with an absent or out-of-date Cargo.lock file {#building-a-crate-with-an-absent-or-out-of-date-cargo.lock-file}
### Building a crate with an absent or out-of-date Cargo.lock file
`buildRustPackage` needs a `Cargo.lock` file to get all dependencies in the
source code in a reproducible way. If it is missing or out-of-date one can use
@@ -368,13 +273,13 @@ rustPlatform.buildRustPackage rec {
}
```
## Compiling non-Rust packages that include Rust code {#compiling-non-rust-packages-that-include-rust-code}
## Compiling non-Rust packages that include Rust code
Several non-Rust packages incorporate Rust code for performance- or
security-sensitive parts. `rustPlatform` exposes several functions and
hooks that can be used to integrate Cargo in non-Rust packages.
### Vendoring of dependencies {#vendoring-of-dependencies}
### Vendoring of dependencies
Since network access is not allowed in sandboxed builds, Rust crate
dependencies need to be retrieved using a fetcher. `rustPlatform`
@@ -403,42 +308,11 @@ attributes can also be used:
the `Cargo.lock`/`Cargo.toml` files need to be patched before
vendoring.
If a `Cargo.lock` file is available, you can alternatively use the
`importCargoLock` function. In contrast to `fetchCargoTarball`, this
function does not require a hash (unless git dependencies are used)
and fetches every dependency as a separate fixed-output derivation.
`importCargoLock` can be used as follows:
```
cargoDeps = rustPlatform.importCargoLock {
lockFile = ./Cargo.lock;
};
```
If the `Cargo.lock` file includes git dependencies, then their output
hashes need to be specified since they are not available through the
lock file. For example:
```
cargoDeps = rustPlatform.importCargoLock {
lockFile = ./Cargo.lock;
outputHashes = {
"rand-0.8.3" = "0ya2hia3cn31qa8894s3av2s8j5bjwb6yq92k0jsnlx7jid0jwqa";
};
};
```
If you do not specify an output hash for a git dependency, building
`cargoDeps` will fail and inform you of which crate needs to be
added. To find the correct hash, you can first use `lib.fakeSha256` or
`lib.fakeHash` as a stub hash. Building `cargoDeps` will then inform
you of the correct hash.
### Hooks {#hooks}
### Hooks
`rustPlatform` provides the following hooks to automate Cargo builds:
* `cargoSetupHook`: configure Cargo to use dependencies vendored
* `cargoSetupHook`: configure Cargo to use depenencies vendored
through `fetchCargoTarball`. This hook uses the `cargoDeps`
environment variable to find the vendored dependencies. If a project
already vendors its dependencies, the variable `cargoVendorDir` can
@@ -448,26 +322,24 @@ you of the correct hash.
* `cargoBuildHook`: use Cargo to build a crate. If the crate to be
built is a crate in e.g. a Cargo workspace, the relative path to the
crate to build can be set through the optional `buildAndTestSubdir`
environment variable. Features can be specified with
`cargoBuildNoDefaultFeatures` and `cargoBuildFeatures`. Additional
Cargo build flags can be passed through `cargoBuildFlags`.
environment variable. Additional Cargo build flags can be passed
through `cargoBuildFlags`.
* `maturinBuildHook`: use [Maturin](https://github.com/PyO3/maturin)
to build a Python wheel. Similar to `cargoBuildHook`, the optional
variable `buildAndTestSubdir` can be used to build a crate in a
Cargo workspace. Additional Maturin flags can be passed through
Cargo workspace. Additional maturin flags can be passed through
`maturinBuildFlags`.
* `cargoCheckHook`: run tests using Cargo. The build type for checks
can be set using `cargoCheckType`. Features can be specified with
`cargoCheckNoDefaultFeaatures` and `cargoCheckFeatures`. Additional
flags can be passed to the tests using `checkFlags` and
`checkFlagsArray`. By default, tests are run in parallel. This can
be disabled by setting `dontUseCargoParallelTests`.
can be set using `cargoCheckType`. Additional flags can be passed to
the tests using `checkFlags` and `checkFlagsArray`. By default,
tests are run in parallel. This can be disabled by setting
`dontUseCargoParallelTests`.
* `cargoInstallHook`: install binaries and static/shared libraries
that were built using `cargoBuildHook`.
### Examples {#examples}
### Examples
#### Python package using `setuptools-rust` {#python-package-using-setuptools-rust}
#### Python package using `setuptools-rust`
For Python packages using `setuptools-rust`, you can use
`fetchCargoTarball` and `cargoSetupHook` to retrieve and set up Cargo
@@ -476,7 +348,7 @@ dependencies. The build itself is then performed by
The following example outlines how the `tokenizers` Python package is
built. Since the Python package is in the `source/bindings/python`
directory of the `tokenizers` project's source archive, we use
directory of the *tokenizers* project's source archive, we use
`sourceRoot` to point the tooling to this directory:
```nix
@@ -553,7 +425,7 @@ buildPythonPackage rec {
}
```
#### Python package using `maturin` {#python-package-using-maturin}
#### Python package using `maturin`
Python packages that use [Maturin](https://github.com/PyO3/maturin)
can be built with `fetchCargoTarball`, `cargoSetupHook`, and
@@ -594,9 +466,9 @@ buildPythonPackage rec {
}
```
## Compiling Rust crates using Nix instead of Cargo {#compiling-rust-crates-using-nix-instead-of-cargo}
## Compiling Rust crates using Nix instead of Cargo
### Simple operation {#simple-operation}
### Simple operation
When run, `cargo build` produces a file called `Cargo.lock`,
containing pinned versions of all dependencies. Nixpkgs contains a
@@ -607,15 +479,14 @@ That Nix expression calls `rustc` directly (hence bypassing Cargo),
and can be used to compile a crate and all its dependencies. Here is
an example for a minimal `hello` crate:
```ShellSession
$ cargo new hello
$ cd hello
$ cargo build
$ cargo new hello
$ cd hello
$ cargo build
Compiling hello v0.1.0 (file:///tmp/hello)
Finished dev [unoptimized + debuginfo] target(s) in 0.20 secs
$ carnix -o hello.nix --src ./. Cargo.lock --standalone
$ nix-build hello.nix -A hello_0_1_0
```
Finished dev [unoptimized + debuginfo] target(s) in 0.20 secs
$ carnix -o hello.nix --src ./. Cargo.lock --standalone
$ nix-build hello.nix -A hello_0_1_0
Now, the file produced by the call to `carnix`, called `hello.nix`, looks like:
@@ -694,14 +565,14 @@ Here, the `libc` crate has no `src` attribute, so `buildRustCrate`
will fetch it from [crates.io](https://crates.io). A `sha256`
attribute is still needed for Nix purity.
### Handling external dependencies {#handling-external-dependencies}
### Handling external dependencies
Some crates require external libraries. For crates from
[crates.io](https://crates.io), such libraries can be specified in
`defaultCrateOverrides` package in nixpkgs itself.
Starting from that file, one can add more overrides, to add features
or build inputs by overriding the hello crate in a separate file.
or build inputs by overriding the hello crate in a seperate file.
```nix
with import <nixpkgs> {};
@@ -753,12 +624,12 @@ with import <nixpkgs> {};
}
```
### Options and phases configuration {#options-and-phases-configuration}
### Options and phases configuration
Actually, the overrides introduced in the previous section are more
general. A number of other parameters can be overridden:
- The version of `rustc` used to compile the crate:
- The version of rustc used to compile the crate:
```nix
(hello {}).override { rust = pkgs.rust; };
@@ -771,7 +642,7 @@ general. A number of other parameters can be overridden:
(hello {}).override { release = false; };
```
- Whether to print the commands sent to `rustc` when building
- Whether to print the commands sent to rustc when building
(equivalent to `--verbose` in cargo:
```nix
@@ -800,7 +671,7 @@ general. A number of other parameters can be overridden:
};
```
### Features {#features}
### Features
One can also supply features switches. For example, if we want to
compile `diesel_cli` only with the `postgres` feature, and no default
@@ -815,15 +686,14 @@ features, we would write:
Where `diesel.nix` is the file generated by Carnix, as explained above.
## Setting Up `nix-shell` {#setting-up-nix-shell}
## Setting Up `nix-shell`
Oftentimes you want to develop code from within `nix-shell`. Unfortunately
`buildRustCrate` does not support common `nix-shell` operations directly
(see [this issue](https://github.com/NixOS/nixpkgs/issues/37945))
so we will use `stdenv.mkDerivation` instead.
Using the example `hello` project above, we want to do the following:
- Have access to `cargo` and `rustc`
- Have the `openssl` library available to a crate through it's _normal_
compilation mechanism (`pkg-config`).
@@ -852,15 +722,13 @@ stdenv.mkDerivation {
```
You should now be able to run the following:
```ShellSession
```ShellSesssion
$ nix-shell --pure
$ cargo build
$ cargo test
```
### Controlling Rust Version Inside `nix-shell` {#controlling-rust-version-inside-nix-shell}
### Controlling Rust Version Inside `nix-shell`
To control your rust version (i.e. use nightly) from within `shell.nix` (or
other nix expressions) you can use the following `shell.nix`
@@ -892,7 +760,6 @@ stdenv.mkDerivation {
```
Now run:
```ShellSession
$ rustc --version
rustc 1.26.0-nightly (188e693b3 2018-03-26)
@@ -900,103 +767,38 @@ rustc 1.26.0-nightly (188e693b3 2018-03-26)
To see that you are using nightly.
## Using community Rust overlays {#using-community-rust-overlays}
There are two community maintained approaches to Rust toolchain management:
- [oxalica's Rust overlay](https://github.com/oxalica/rust-overlay)
- [fenix](https://github.com/nix-community/fenix)
## Using the Rust nightlies overlay
Oxalica's overlay allows you to select a particular Rust version and components.
See [their documentation](https://github.com/oxalica/rust-overlay#rust-overlay) for more
detailed usage.
Mozilla provides an overlay for nixpkgs to bring a nightly version of Rust into scope.
This overlay can _also_ be used to install recent unstable or stable versions
of Rust, if desired.
Fenix is an alternative to `rustup` and can also be used as an overlay.
Both oxalica's overlay and fenix better integrate with nix and cache optimizations.
Because of this and ergonomics, either of those community projects
should be preferred to the Mozilla's Rust overlay (`nixpkgs-mozilla`).
### How to select a specific `rustc` and toolchain version {#how-to-select-a-specific-rustc-and-toolchain-version}
You can consume the oxalica overlay and use it to grab a specific Rust toolchain version.
Here is an example `shell.nix` showing how to grab the current stable toolchain:
```nix
{ pkgs ? import <nixpkgs> {
overlays = [
(import (fetchTarball "https://github.com/oxalica/rust-overlay/archive/master.tar.gz"))
];
}
}:
pkgs.mkShell {
nativeBuildInputs = with pkgs; [
pkg-config
rust-bin.stable.latest.minimal
];
}
```
You can try this out by:
1. Saving that to `shell.nix`
2. Executing `nix-shell --pure --command 'rustc --version'`
As of writing, this prints out `rustc 1.56.0 (09c42c458 2021-10-18)`.
### How to use an overlay toolchain in a derivation {#how-to-use-an-overlay-toolchain-in-a-derivation}
You can also use an overlay's Rust toolchain with `buildRustPackage`.
The below snippet demonstrates invoking `buildRustPackage` with an oxalica overlay selected Rust toolchain:
```nix
with import <nixpkgs> {
overlays = [
(import (fetchTarball "https://github.com/oxalica/rust-overlay/archive/master.tar.gz"))
];
};
rustPlatform.buildRustPackage rec {
pname = "ripgrep";
version = "12.1.1";
nativeBuildInputs = [
rust-bin.stable.latest.minimal
];
src = fetchFromGitHub {
owner = "BurntSushi";
repo = "ripgrep";
rev = version;
sha256 = "1hqps7l5qrjh9f914r5i6kmcz6f1yb951nv4lby0cjnp5l253kps";
};
cargoSha256 = "03wf9r2csi6jpa7v5sw5lpxkrk4wfzwmzx7k3991q3bdjzcwnnwp";
meta = with lib; {
description = "A fast line-oriented regex search tool, similar to ag and ack";
homepage = "https://github.com/BurntSushi/ripgrep";
license = licenses.unlicense;
maintainers = [ maintainers.tailhook ];
};
}
```
Follow the below steps to try that snippet.
1. create a new directory
1. save the above snippet as `default.nix` in that directory
1. cd into that directory and run `nix-build`
### Rust overlay installation {#rust-overlay-installation}
### Rust overlay installation
You can use this overlay by either changing your local nixpkgs configuration,
or by adding the overlay declaratively in a nix expression, e.g. in `configuration.nix`.
For more information see [the manual on installing overlays](#sec-overlays-install).
For more information see [#sec-overlays-install](the manual on installing overlays).
### Declarative Rust overlay installation {#declarative-rust-overlay-installation}
#### Imperative rust overlay installation
Clone [nixpkgs-mozilla](https://github.com/mozilla/nixpkgs-mozilla),
and create a symbolic link to the file
[rust-overlay.nix](https://github.com/mozilla/nixpkgs-mozilla/blob/master/rust-overlay.nix)
in the `~/.config/nixpkgs/overlays` directory.
$ git clone https://github.com/mozilla/nixpkgs-mozilla.git
$ mkdir -p ~/.config/nixpkgs/overlays
$ ln -s $(pwd)/nixpkgs-mozilla/rust-overlay.nix ~/.config/nixpkgs/overlays/rust-overlay.nix
### Declarative rust overlay installation
This snippet shows how to use oxalica's Rust overlay.
Add the following to your `configuration.nix`, `home-configuration.nix`, `shell.nix`, or similar:
```nix
{ pkgs ? import <nixpkgs> {
overlays = [
(import (builtins.fetchTarball "https://github.com/oxalica/rust-overlay/archive/master.tar.gz"))
(import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz))
# Further overlays go here
];
};
@@ -1004,3 +806,32 @@ Add the following to your `configuration.nix`, `home-configuration.nix`, `shell.
```
Note that this will fetch the latest overlay version when rebuilding your system.
### Rust overlay usage
The overlay contains attribute sets corresponding to different versions of the rust toolchain, such as:
* `latest.rustChannels.stable`
* `latest.rustChannels.nightly`
* a function `rustChannelOf`, called as `(rustChannelOf { date = "2018-04-11"; channel = "nightly"; })`, or...
* `(nixpkgs.rustChannelOf { rustToolchain = ./rust-toolchain; })` if you have a local `rust-toolchain` file (see https://github.com/mozilla/nixpkgs-mozilla#using-in-nix-expressions for an example)
Each of these contain packages such as `rust`, which contains your usual rust development tools with the respective toolchain chosen.
For example, you might want to add `latest.rustChannels.stable.rust` to the list of packages in your configuration.
Imperatively, the latest stable version can be installed with the following command:
$ nix-env -Ai nixpkgs.latest.rustChannels.stable.rust
Or using the attribute with nix-shell:
$ nix-shell -p nixpkgs.latest.rustChannels.stable.rust
Substitute the `nixpkgs` prefix with `nixos` on NixOS.
To install the beta or nightly channel, "stable" should be substituted by
"nightly" or "beta", or
use the function provided by this overlay to pull a version based on a
build date.
The overlay automatically updates itself as it uses the same source as
[rustup](https://www.rustup.rs/).

View File

@@ -5,7 +5,6 @@ Since release 15.09 there is a new TeX Live packaging that lives entirely under
## User's guide {#sec-language-texlive-user-guide}
- For basic usage just pull `texlive.combined.scheme-basic` for an environment with basic LaTeX support.
- It typically won't work to use separately installed packages together. Instead, you can build a custom set of packages like this:
```nix
@@ -15,7 +14,6 @@ Since release 15.09 there is a new TeX Live packaging that lives entirely under
```
- There are all the schemes, collections and a few thousand packages, as defined upstream (perhaps with tiny differences).
- By default you only get executables and files needed during runtime, and a little documentation for the core packages. To change that, you need to add `pkgFilter` function to `combine`.
```nix

View File

@@ -9,8 +9,8 @@ applications for Android and iOS devices from source code.
Not all Titanium features supported -- currently, it can only be used to build
Android and iOS apps.
## Building a Titanium app {#building-a-titanium-app}
Building a Titanium app
-----------------------
We can build a Titanium app from source for Android or iOS and for debugging or
release purposes by invoking the `titaniumenv.buildApp {}` function:
@@ -103,8 +103,8 @@ When `enableWirelessDistribution` has been enabled, you must also provide the
path of the PHP script (`installURL`) (that is included with the iOS build
environment) to enable wireless ad-hoc installations.
## Emulating or simulating the app {#emulating-or-simulating-the-app}
Emulating or simulating the app
-------------------------------
It is also possible to simulate the correspond iOS simulator build by using
`xcodeenv.simulateApp {}` and emulate an Android APK by using
`androidenv.emulateApp {}`.

View File

@@ -12,7 +12,7 @@ At the moment we support three different methods for managing plugins:
- Pathogen
- vim-plug
## Custom configuration {#custom-configuration}
## Custom configuration
Adding custom .vimrc lines can be done using the following code:
@@ -56,7 +56,7 @@ neovim-qt.override {
}
```
## Managing plugins with Vim packages {#managing-plugins-with-vim-packages}
## Managing plugins with Vim packages
To store you plugins in Vim packages (the native Vim plugin manager, see `:help packages`) the following example can be used:
@@ -116,11 +116,11 @@ The resulting package can be added to `packageOverrides` in `~/.nixpkgs/config.n
After that you can install your special grafted `myVim` or `myNeovim` packages.
### What if your favourite Vim plugin isnt already packaged? {#what-if-your-favourite-vim-plugin-isnt-already-packaged}
### What if your favourite Vim plugin isn't already packaged?
If one of your favourite plugins isn't packaged, you can package it yourself:
```nix
```
{ config, pkgs, ... }:
let
@@ -154,34 +154,7 @@ in
}
```
### Specificities for some plugins
#### Tree sitter
By default `nvim-treesitter` encourages you to download, compile and install
the required tree-sitter grammars at run time with `:TSInstall`. This works
poorly on NixOS. Instead, to install the `nvim-treesitter` plugins with a set
of precompiled grammars, you can use `nvim-treesitter.withPlugins` function:
```nix
(pkgs.neovim.override {
configure = {
packages.myPlugins = with pkgs.vimPlugins; {
start = [
(nvim-treesitter.withPlugins (
plugins: with plugins; [
tree-sitter-nix
tree-sitter-python
]
))
];
};
};
})
```
To enable all grammars packaged in nixpkgs, use `(pkgs.vimPlugins.nvim-treesitter.withPlugins (plugins: pkgs.tree-sitter.allGrammars))`.
## Managing plugins with vim-plug {#managing-plugins-with-vim-plug}
## Managing plugins with vim-plug
To use [vim-plug](https://github.com/junegunn/vim-plug) to manage your Vim
plugins the following example can be used:
@@ -210,14 +183,14 @@ neovim.override {
}
```
## Managing plugins with VAM {#managing-plugins-with-vam}
## Managing plugins with VAM
### Handling dependencies of Vim plugins {#handling-dependencies-of-vim-plugins}
### Handling dependencies of Vim plugins
VAM introduced .json files supporting dependencies without versioning
assuming that "using latest version" is ok most of the time.
### Example {#example}
### Example
First create a vim-scripts file having one plugin name per line. Example:
@@ -307,9 +280,9 @@ Sample output2:
]
```
## Adding new plugins to nixpkgs {#adding-new-plugins-to-nixpkgs}
## Adding new plugins to nixpkgs
Nix expressions for Vim plugins are stored in [pkgs/misc/vim-plugins](/pkgs/misc/vim-plugins). For the vast majority of plugins, Nix expressions are automatically generated by running [`./update.py`](/pkgs/misc/vim-plugins/update.py). This creates a [generated.nix](/pkgs/misc/vim-plugins/generated.nix) file based on the plugins listed in [vim-plugin-names](/pkgs/misc/vim-plugins/vim-plugin-names). Plugins are listed in alphabetical order in `vim-plugin-names` using the format `[github username]/[repository]@[gitref]`. For example https://github.com/scrooloose/nerdtree becomes `scrooloose/nerdtree`.
Nix expressions for Vim plugins are stored in [pkgs/misc/vim-plugins](/pkgs/misc/vim-plugins). For the vast majority of plugins, Nix expressions are automatically generated by running [`./update.py`](/pkgs/misc/vim-plugins/update.py). This creates a [generated.nix](/pkgs/misc/vim-plugins/generated.nix) file based on the plugins listed in [vim-plugin-names](/pkgs/misc/vim-plugins/vim-plugin-names). Plugins are listed in alphabetical order in `vim-plugin-names` using the format `[github username]/[repository]`. For example https://github.com/scrooloose/nerdtree becomes `scrooloose/nerdtree`.
Some plugins require overrides in order to function properly. Overrides are placed in [overrides.nix](/pkgs/misc/vim-plugins/overrides.nix). Overrides are most often required when a plugin requires some dependencies, or extra steps are required during the build process. For example `deoplete-fish` requires both `deoplete-nvim` and `vim-fish`, and so the following override was added:
@@ -325,7 +298,7 @@ To add a new plugin, run `./update.py --add "[owner]/[name]"`. **NOTE**: This sc
Finally, there are some plugins that are also packaged in nodePackages because they have Javascript-related build steps, such as running webpack. Those plugins are not listed in `vim-plugin-names` or managed by `update.py` at all, and are included separately in `overrides.nix`. Currently, all these plugins are related to the `coc.nvim` ecosystem of Language Server Protocol integration with vim/neovim.
## Updating plugins in nixpkgs {#updating-plugins-in-nixpkgs}
## Updating plugins in nixpkgs
Run the update script with a GitHub API token that has at least `public_repo` access. Running the script without the token is likely to result in rate-limiting (429 errors). For steps on creating an API token, please refer to [GitHub's token documentation](https://docs.github.com/en/free-pro-team@latest/github/authenticating-to-github/creating-a-personal-access-token).
@@ -339,7 +312,7 @@ Alternatively, set the number of processes to a lower count to avoid rate-limiti
./pkgs/misc/vim-plugins/update.py --proc 1
```
## Important repositories {#important-repositories}
## Important repositories
- [vim-pi](https://bitbucket.org/vimcommunity/vim-pi) is a plugin repository
from VAM plugin manager meant to be used by others as well used by

View File

@@ -8,9 +8,9 @@
<xi:include href="preface.chapter.xml" />
<part>
<title>Using Nixpkgs</title>
<xi:include href="using/configuration.chapter.xml" />
<xi:include href="using/overlays.chapter.xml" />
<xi:include href="using/overrides.chapter.xml" />
<xi:include href="using/configuration.xml" />
<xi:include href="using/overlays.xml" />
<xi:include href="using/overrides.xml" />
<xi:include href="functions.xml" />
</part>
<part>

View File

@@ -12,7 +12,7 @@ Nixpkgs. If you like to learn more about the Nix package manager and the Nix
expression language, then you are kindly referred to the [Nix manual](https://nixos.org/nix/manual/).
The NixOS distribution is documented in the [NixOS manual](https://nixos.org/nixos/manual/).
## Overview of Nixpkgs {#overview-of-nixpkgs}
## Overview of Nixpkgs
Nix expressions describe how to build packages from source and are collected in
the [nixpkgs repository](https://github.com/NixOS/nixpkgs). Also included in the

View File

@@ -6,6 +6,7 @@
This chapter will be organized in three parts. First, it will describe the basics of how to package software in a way that supports cross-compilation. Second, it will describe how to use Nixpkgs when cross-compiling. Third, it will describe the internal infrastructure supporting cross-compilation.
## Packaging in a cross-friendly manner {#sec-cross-packaging}
### Platform parameters {#ssec-cross-platform-parameters}
@@ -64,8 +65,8 @@ The exact schema these fields follow is a bit ill-defined due to a long and conv
### Theory of dependency categorization {#ssec-cross-dependency-categorization}
::: {.note}
This is a rather philosophical description that isn't very Nixpkgs-specific. For an overview of all the relevant attributes given to `mkDerivation`, see [](#ssec-stdenv-dependencies). For a description of how everything is implemented, see [](#ssec-cross-dependency-implementation).
::: note
This is a rather philosophical description that isn't very Nixpkgs-specific. For an overview of all the relevant attributes given to `mkDerivation`, see <xref linkend="ssec-stdenv-dependencies"/>. For a description of how everything is implemented, see <xref linkend="ssec-cross-dependency-implementation"/>.
:::
In this section we explore the relationship between both runtime and build-time dependencies and the 3 Autoconf platforms.
@@ -80,10 +81,10 @@ Finally, if the depending package is a compiler or other machine-code-producing
Putting this all together, that means we have dependencies in the form "host → target", in at most the following six combinations:
#### Possible dependency types {#possible-dependency-types}
| Dependencys host platform | Dependencys target platform |
|----------------------------|------------------------------|
#### Possible dependency types
| Dependency's host platform | Dependency's target platform |
| -- | -- |
| build | build |
| build | host |
| build | target |
@@ -112,18 +113,15 @@ On less powerful machines, it can be inconvenient to cross-compile a package onl
$ nix-build '<nixpkgs>' -A pkgsCross.raspberryPi.hello
```
#### What if my packages build system needs to build a C program to be run under the build environment? {#cross-qa-build-c-program-in-build-environment}
#### What if my package's build system needs to build a C program to be run under the build environment? {#cross-qa-build-c-program-in-build-environment}
Add the following to your `mkDerivation` invocation.
```nix
depsBuildBuild = [ buildPackages.stdenv.cc ];
```
#### My packages testsuite needs to run host platform code. {#cross-testsuite-runs-host-code}
#### My package's testsuite needs to run host platform code. {#cross-testsuite-runs-host-code}
Add the following to your `mkDerivation` invocation.
```nix
doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
```
@@ -136,7 +134,7 @@ Nixpkgs can be instantiated with `localSystem` alone, in which case there is no
$ nix-build '<nixpkgs>' --arg crossSystem '(import <nixpkgs/lib>).systems.examples.fooBarBaz' -A whatever
```
::: {.note}
::: note
Eventually we would like to make these platform examples an unnecessary convenience so that
```ShellSession
@@ -148,7 +146,7 @@ works in the vast majority of cases. The problem today is dependencies on other
While one is free to pass both parameters in full, there's a lot of logic to fill in missing fields. As discussed in the previous section, only one of `system`, `config`, and `parsed` is needed to infer the other two. Additionally, `libc` will be inferred from `parse`. Finally, `localSystem.system` is also _impurely_ inferred based on the platform evaluation occurs. This means it is often not necessary to pass `localSystem` at all, as in the command-line example in the previous paragraph.
::: {.note}
::: note
Many sources (manual, wiki, etc) probably mention passing `system`, `platform`, along with the optional `crossSystem` to Nixpkgs: `import <nixpkgs> { system = ..; platform = ..; crossSystem = ..; }`. Passing those two instead of `localSystem` is still supported for compatibility, but is discouraged. Indeed, much of the inference we do for these parameters is motivated by compatibility as much as convenience.
:::
@@ -158,9 +156,9 @@ One would think that `localSystem` and `crossSystem` overlap horribly with the t
### Implementation of dependencies {#ssec-cross-dependency-implementation}
The categories of dependencies developed in [](#ssec-cross-dependency-categorization) are specified as lists of derivations given to `mkDerivation`, as documented in [](#ssec-stdenv-dependencies). In short, each list of dependencies for "host → target" is called `deps<host><target>` (where `host`, and `target` values are either `build`, `host`, or `target`), with exceptions for backwards compatibility that `depsBuildHost` is instead called `nativeBuildInputs` and `depsHostTarget` is instead called `buildInputs`. Nixpkgs is now structured so that each `deps<host><target>` is automatically taken from `pkgs<host><target>`. (These `pkgs<host><target>`s are quite new, so there is no special case for `nativeBuildInputs` and `buildInputs`.) For example, `pkgsBuildHost.gcc` should be used at build-time, while `pkgsHostTarget.gcc` should be used at run-time.
The categories of dependencies developed in <xref linkend="ssec-cross-dependency-categorization"/> are specified as lists of derivations given to `mkDerivation`, as documented in <xref linkend="ssec-stdenv-dependencies"/>. In short, each list of dependencies for "host → target" of "foo → bar" is called `depsFooBar`, with exceptions for backwards compatibility that `depsBuildHost` is instead called `nativeBuildInputs` and `depsHostTarget` is instead called `buildInputs`. Nixpkgs is now structured so that each `depsFooBar` is automatically taken from `pkgsFooBar`. (These `pkgsFooBar`s are quite new, so there is no special case for `nativeBuildInputs` and `buildInputs`.) For example, `pkgsBuildHost.gcc` should be used at build-time, while `pkgsHostTarget.gcc` should be used at run-time.
Now, for most of Nixpkgs's history, there were no `pkgs<host><target>` attributes, and most packages have not been refactored to use it explicitly. Prior to those, there were just `buildPackages`, `pkgs`, and `targetPackages`. Those are now redefined as aliases to `pkgsBuildHost`, `pkgsHostTarget`, and `pkgsTargetTarget`. It is acceptable, even recommended, to use them for libraries to show that the host platform is irrelevant.
Now, for most of Nixpkgs's history, there were no `pkgsFooBar` attributes, and most packages have not been refactored to use it explicitly. Prior to those, there were just `buildPackages`, `pkgs`, and `targetPackages`. Those are now redefined as aliases to `pkgsBuildHost`, `pkgsHostTarget`, and `pkgsTargetTarget`. It is acceptable, even recommended, to use them for libraries to show that the host platform is irrelevant.
But before that, there was just `pkgs`, even though both `buildInputs` and `nativeBuildInputs` existed. \[Cross barely worked, and those were implemented with some hacks on `mkDerivation` to override dependencies.\] What this means is the vast majority of packages do not use any explicit package set to populate their dependencies, just using whatever `callPackage` gives them even if they do correctly sort their dependencies into the multiple lists described above. And indeed, asking that users both sort their dependencies, _and_ take them from the right attribute set, is both too onerous and redundant, so the recommended approach (for now) is to continue just categorizing by list and not using an explicit package set.
@@ -180,7 +178,7 @@ While there are many package sets, and thus many edges, the stages can also be a
In each stage, `pkgsBuildHost` refers to the previous stage, `pkgsBuildBuild` refers to the one before that, and `pkgsHostTarget` refers to the current one, and `pkgsTargetTarget` refers to the next one. When there is no previous or next stage, they instead refer to the current stage. Note how all the invariants regarding the mapping between dependency and depending packages' build host and target platforms are preserved. `pkgsBuildTarget` and `pkgsHostHost` are more complex in that the stage fitting the requirements isn't always a fixed chain of "prevs" and "nexts" away (modulo the "saturating" self-references at the ends). We just special case each instead. All the primary edges are implemented is in `pkgs/stdenv/booter.nix`, and secondarily aliases in `pkgs/top-level/stage.nix`.
::: {.note}
::: note
The native stages are bootstrapped in legacy ways that predate the current cross implementation. This is why the bootstrapping stages leading up to the final stages are ignored in the previous paragraph.
:::
@@ -188,7 +186,6 @@ If one looks at the 3 platform triples, one can see that they overlap such that
```
(native, native, native, foreign, foreign)
```
If one imagines the saturating self references at the end being replaced with infinite stages, and then overlays those platform triples, one ends up with the infinite tuple:
```
(native..., native, native, native, foreign, foreign, foreign...)
@@ -196,8 +193,8 @@ If one imagines the saturating self references at the end being replaced with in
One can then imagine any sequence of platforms such that there are bootstrap stages with their 3 platforms determined by "sliding a window" that is the 3 tuple through the sequence. This was the original model for bootstrapping. Without a target platform (assume a better world where all compilers are multi-target and all standard libraries are built in their own derivation), this is sufficient. Conversely if one wishes to cross compile "faster", with a "Canadian Cross" bootstrapping stage where `build != host != target`, more bootstrapping stages are needed since no sliding window provides the pesky `pkgsBuildTarget` package set since it skips the Canadian cross stage's "host".
::: {.note}
It is much better to refer to `buildPackages` than `targetPackages`, or more broadly package sets that do not mention target. There are three reasons for this.
::: note
It is much better to refer to `buildPackages` than `targetPackages`, or more broadly package sets that do not mention "target". There are three reasons for this.
First, it is because bootstrapping stages do not have a unique `targetPackages`. For example a `(x86-linux, x86-linux, arm-linux)` and `(x86-linux, x86-linux, x86-windows)` package set both have a `(x86-linux, x86-linux, x86-linux)` package set. Because there is no canonical `targetPackages` for such a native (`build == host == target`) package set, we set their `targetPackages`
@@ -206,6 +203,6 @@ Second, it is because this is a frequent source of hard-to-follow "infinite recu
Thirdly, it is because everything target-mentioning only exists to accommodate compilers with lousy build systems that insist on the compiler itself and standard library being built together. Of course that is bad because bigger derivations means longer rebuilds. It is also problematic because it tends to make the standard libraries less like other libraries than they could be, complicating code and build systems alike. Because of the other problems, and because of these innate disadvantages, compilers ought to be packaged another way where possible.
:::
::: {.note}
If one explores Nixpkgs, they will see derivations with names like `gccCross`. Such `*Cross` derivations is a holdover from before we properly distinguished between the host and target platforms—the derivation with Cross in the name covered the `build = host != target` case, while the other covered the `host = target`, with build platform the same or not based on whether one was using its `.nativeDrv` or `.crossDrv`. This ugliness will disappear soon.
::: note
If one explores Nixpkgs, they will see derivations with names like `gccCross`. Such `*Cross` derivations is a holdover from before we properly distinguished between the host and target platforms—the derivation with "Cross" in the name covered the `build = host != target` case, while the other covered the `host = target`, with build platform the same or not based on whether one was using its `.nativeDrv` or `.crossDrv`. This ugliness will disappear soon.
:::

Some files were not shown because too many files have changed in this diff Show More