35 Commits

Author SHA1 Message Date
Marcin Serwin 85ac6ca088 maintainers: drop ttuegel
Signed-off-by: Marcin Serwin <marcin@serwin.dev>
2026-05-31 20:27:39 +02:00
Michael Peyton Jones aac4e39ed0 haskellPackages: move hoogle docPackages into passthru
This can get very big and lead to "command line length exceeded" errors
when building hoogle databases for large numbers of packages.
2026-05-26 17:08:20 +01:00
h7x4 5f36e60ee8 nixos/tests/hoogle: init 2025-10-18 04:18:33 +09:00
NAHO c8d4dabc43 pkgs: remove optional builtins prefixes from prelude functions
Remove optional builtins prefixes from prelude functions by running:

    builtins=(
      abort
      baseNameOf
      break
      derivation
      derivationStrict
      dirOf
      false
      fetchGit
      fetchMercurial
      fetchTarball
      fetchTree
      fromTOML
      import
      isNull
      map
      null
      placeholder
      removeAttrs
      scopedImport
      throw
      toString
      true
    )

    fd \
      --type file \
      . \
      pkgs \
      --exec-batch sed --in-place --regexp-extended "
        s/\<builtins\.($(
          printf '%s\n' "${builtins[@]}" |
            paste --delimiter '|' --serial -
        ))\>/\1/g
      "

    nix fmt
2025-10-04 19:02:37 +02:00
sternenseemann 7b5b5fe515 treewide: drop GHCJS specific code
This affects haskelPackages.mkDerivation, ghcWithPackages and
hoogleWithPackages which means that it is not possible to re-introduce
a ghcjs derivation downstream and create a ghcjs package set with an up
to date Nixpkgs.
2025-09-06 14:56:31 +02:00
Rebecca Turner 03c44317c8 haskellPackages.ghcWithHoogle: add passthru.hoogle
Package sets built with `haskellPackages.ghcWithHoogle` provide a Hoogle
executable which points to a Hoogle database, but there's no way to
programmatically access the derivation containing the Hoogle database
from the package set.

This adds a `passthru.hoogle` attribute to package sets built with
`haskellPackages.ghcWithHoogle`, and a `passthru.database` helper to
derivations built with `haskellPackages.hoogleWithPackages`.
2025-05-01 16:19:22 -07:00
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build https://github.com/infinisil/treewide-nixpkgs-reformat-script/archive/a08b3a4d199c6124ac5b36a889d9099b4383463f.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00
Alexis Hildebrandt 755b915a15 treewide: Remove indefinite article from meta.description
nix run nixpkgs#silver-searcher -- -G '\.nix$' -0l 'description.*"[Aa]n?' pkgs \
  | xargs -0 nix run nixpkgs#gnused -- -i '' -Ee 's/(description.*")[Aa]n? (.)/\1\U\2/'
2024-06-09 23:07:45 +02:00
Guillaume Bouchard 98715e1b1a lib.closePropagation: Remove the quadratic behavior in lib.closePropagation
The code of `lib.closePropagation` was internally using a
recursion on the dependencies and returns all the derivation directly or
indirectly referenced by buildInputs.

`lib.closeProgation` is implemented in pure nix and uses an unique
function for list which is quadratic and does "true" equality, which
needs deep set comparison.

Instead, we use the `builtins.genericClosure` which is implemented as a
builtin and uses a more efficient sorting feature.

Note that `genericClosure` needs a `key` to discriminate the values, we
used the `outPath` which is unique and orderable.

On benchmarks, it performs up to 15x time faster on a benchmark related
to haskellPackages.ghcWithPackages.
2022-10-07 18:03:42 +02:00
Malte Brandy a0809c0293 haskellPackages.hoogleLocal: allow substitutes again
This is a follow up to the discussion in https://github.com/NixOS/nixpkgs/pull/165337
2022-06-05 13:17:43 +02:00
Profpatsch 7f08e0ca6d haskellPackages.hoogleLocal: build database locally 2022-03-22 22:36:59 +01:00
sternenseemann fb075fab73 haskellPackages.{ghcWithPackages, ghcWithHoogle}: make overrideable
This is achieved by passing the entire package set to the respective
wrappers and passing the select function as a second attribute. Together
with the new support for callPackage-ing functions this allows for
things like `ghcWithPackages.override { useLLVM = true; } (p: [ … ])`.

To make this possible for `ghcWithHoogle` as well, we need to make the
wrapper a bit more bespoke and inline the hoogle feature as well. The
hoogle wrapper, however, can remain separate and is exposed as
`hoogleWithPackages` additionally, as it can also serve standalone use.
`hoogleLocal` is kept for backwards compatibility (including the old,
suboptimal API), but will inform users about the better alternative via
a warning.
2022-01-06 12:21:45 +01:00
Joe Hermaszewski d8daa7af73 haskellPackages.shellFor: Work around hoogle generation failure
Workaround for https://github.com/NixOS/nixpkgs/issues/82245

Although this doesn't tackle the root cause of a null package sneaking
in (via executableHaskellDepends), it does effectively treat the symptom
by just ignoring any null packages.

Seeing as that issue has been open for more than a year I think this
band-aid is necessary.
2021-06-16 12:13:49 +08:00
volth bc0d605cf1 treewide: fix double quoted strings in meta.description
Signed-off-by: Ben Siraphob <bensiraphob@gmail.com>
2021-01-24 19:56:59 +07:00
Ben Siraphob 2f78ee7e81 pkgs/development: stdenv.lib -> lib 2021-01-24 00:16:29 +07:00
John Ericson ad93663a48 ghcWithHoogle: Fix for cross
Use `buildPackages.stdenv.mkDerivation` because we are making a shell
script to start hoogle on the build platform.
2019-12-24 18:17:41 -05:00
Travis Whitaker f1e3a6961b Pass hoogle-local's buildCommand as a file.
This is necessary when a very large number of packages are included in the
package database. Without this change, setting up the build environment will
fail, since the environment will be too large.

This simply applies the technique mentioned in
https://github.com/NixOS/nixpkgs/issues/25057 to solve this problem.
2019-09-03 09:23:28 +02:00
volth 6d2857a311 [bot] treewide: remove unused 'inherit' in let blocks 2018-07-20 19:38:19 +00:00
volth 87f5930c3f [bot]: remove unreferenced code 2018-07-20 18:48:37 +00:00
Peter Simons f13f2434d0 Revert "Fix null deps in ghcWithHoogle" 2018-06-22 14:21:44 +02:00
Will Fancher dc7a91392e Fix null deps in ghcWithHoogle 2018-06-21 17:53:37 -04:00
Peter Simons 6fe751fb5c ghcWithHoogle: deal gracefully with packages that have no haddockDir attribute 2017-08-19 17:20:39 +02:00
Peter Simons 01b8c4c9e5 ghcWithHoogle: cosmetic for the sake of Emacs syntax highlighting 2017-08-19 17:19:47 +02:00
Profpatsch 4a8efae000 pkgs/haskell-modules/hoogle.nix: find haddocks by haddockDir
Previously a few clumsy shell globs were used to find haddock output, which
broke every time something in `generic-builder.nix` changed.
Use the new `haddockDir` identifier exported by haskell packages.
2017-08-06 22:02:50 +02:00
Bas van Dijk 057fae5ea0 ghcWithHoogle: fix for ghcjs
`haskell.packages.ghcjs.ghcWithHoogle` failed because the following line:

  for docdir in ${ghc.doc}/${docLibGlob}/*; do

failed because `doc` is not an attribute of `ghc` when `ghc` is
substituted for ghcjs.
2017-02-14 22:50:29 +01:00
Profpatsch b8a69aaba9 haskell/hoogle.nix: make an empty packages list possible
Building hoogle environments with an empty list of packages threw a built-time
error. This was particularly confusing when giving e.g. `(hps: [hps.Cabal])`
which, since `Cabal` is set to `null` (because it’s a distribution package),
would have lead to the same error as an empty list.

It was not useful to throw an error at all, because sometimes one only wants to
build an environment for the distribution packages; also the default value for
packages wasn’t even a valid value, so it is removed.
2016-11-24 12:31:58 +01:00
Michael Alan Dorman f16f2017ac Make hoogle-local compatible wih hoogle >= 5.0.4 2016-09-20 12:04:46 +02:00
Alexey Shmalko 87aa864ff9 haskell-hoogle: adapt to GHC docs split
The docs were split at #16167 and broke google support. @peti fixed
build, however hoogle still didn't see packages shipped with GHC. This
patch fixes location of the libraries shipped with GHC.
2016-06-20 22:52:20 +03:00
Peter Simons 06489a1850 haskell-hoogle: remedy some fallout from https://github.com/NixOS/nixpkgs/pull/16167
ghcWithHoogle builds with this patch applied, but it's probably still broken in
the sense that links might point nowhere or that the generated databases and/or
documentation might be incomplete.
2016-06-20 14:50:52 +02:00
Charles Strahan 142b417284 ghcWithHoogle: fix haddocks for GHCJS builtin libs 2016-02-01 00:10:45 -05:00
Charles Strahan 1a2d7c679a ghcWithHoogle: add support for ghcjs 2016-01-31 23:00:43 -05:00
Peter Simons 07542d12ea hoogle: use $NIX_BUILD_CORES to determine the proper level of parallelism for database creation 2015-09-02 16:28:01 +02:00
Jan Malakhovski 0013743845 haskell-packages: make hoogle wrapper much more helpful
* Build most of the stuff on /tmp, not in /nix/store.
* Generate hoogle database for all the dependencies.
* Generate haddock index and contents files.
* Cleanup.
2015-08-18 19:56:17 +00:00
Jan Malakhovski d8487667cf haskell-packages: bring hoogle to the masses by imlementing ghcWithHoogle
Replace `ghcWithPackages` to `ghcWithHoogle` in your config and enjoy.
2015-08-18 19:56:16 +00:00
Charles Strahan 3859f7bdab haskell-ng: hoogleLocal support 2015-06-11 20:25:31 -04:00