Commit Graph

141 Commits

Author SHA1 Message Date
whispers
80bdbb7475 gnome2: drop package set
the gnome2 namespace nebulously refers to an gnome 2, a desktop we never
properly packaged. now it holds a bunch of gtk2 or otherwise unused
packages. its contents were handled in previous commits, and now that it
is empty except for aliases, we drop the namespace entirely. aliases
were added only for the recent additions to the list, as the ones from
before 2024 seem to have little use and are no longer kept in
aliases.nix.
2026-08-05 22:23:31 -04:00
Alex Tunstall
e805baacb7 haskell.{compiler,packages}.microhs: init
The package set is built entirely from source using the stdenv and Hugs.

This also replaces the recently added microhs package, which was built
from pre-generated compiler output.

Co-authored-by: sternenseemann <sternenseemann@systemli.org>
2026-04-09 22:33:33 +01:00
Wolfgang Walther
ed3110d0e7 haskellModules.haskellSrc2nix: move LANG and LOCALE_ARCHIVE into env (#484750) 2026-02-26 09:52:12 +00:00
quantenzitrone
73d9a1c6ec various: remove last remaining references to pkgs.xorg 2026-02-02 00:20:12 +01:00
Stefan Frijters
dfd6999195 haskellModules.haskellSrc2nix: move LANG and LOCALE_ARCHIVE into env 2026-01-28 21:15:41 +01:00
K900
f54c9f15f8 Merge remote-tracking branch 'origin/staging-next' into staging 2026-01-11 21:58:16 +03:00
Robert Hensing
5a38e15e6d haskellPackages.buildFromCabalSdist: add test, fix double-patch
srcOnly applies patches, but the resulting derivation still had the
patches attribute, causing patchPhase to apply them again. Clear
patches after srcOnly to prevent double-application.
2025-12-28 15:26:33 +01:00
sternenseemann
3692288912 haskellPackages.buildFromCabalSdist: respect patches 2025-12-28 10:18:55 +01:00
Alexandre Esteves
20df4a1dbe haskellPackages: support Template Haskell when cross compiling
This makes TH work when cross-compiling between aarch64 and x86_64 for
both glibc and musl.

pkgsStatic does not work, yet and neither does darwin.
2025-11-30 19:14:31 +01:00
Robert Hensing
cb7163d8f3 haskellPackages.cabalSdist: remove ghc workaround
The workaround added in https://github.com/NixOS/nixpkgs/pull/187726
for https://github.com/haskell/cabal/issues/8352 is no longer needed.

cabal-install 3.8.1.0 introduced a regression where `cabal sdist`
required GHC to be in PATH. This was fixed in cabal-install 3.10.1.0
(https://github.com/haskell/cabal/pull/8358), and nixpkgs now uses
cabal-install 3.16.0.0.

tests.haskell.cabalSdist passes.
2025-11-21 19:16:27 +01: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
78e50a3885 haskellPackages.callPackage: preserve functionArgs (#443442) 2025-09-22 11:26:13 +00:00
Daniil Iaitskov
daad170113 haskellPackages.callHackageDirect: add optional candidate attribute 2025-09-19 21:05:47 +02:00
sternenseemann
1a14dc6e44 haskellPackages.callPackage: preserve functionArgs
Our wrapper for lib.makeOverridable wraps the underlying function which
means the wrapper function doesn't replicate the same set pattern.
We can, however, tell lib.functionArgs about the permissible arguments
by making the function a functor and adding __functionArgs.
2025-09-16 15:54:43 +02:00
sternenseemann
a2b6624139 {forceLlvmCodegenBackend,ghcWithPackages}: update clang -fllvm logic
- The LLVM backend always needs an LLVM specific assembler, i.e. clang
  that ideally matches the version of LLVM actually used for codegen.

- The LLVM backend on Darwin requires some version of clang to be
  available. In light of LLVMAS, using a matching version seems to be
  best though this does risk messing with clang used for compiling C
  in the derivation.

  This mess can be avoided by compiling GHC with useLLVM = true which
  sets absolute paths in GHC's settings file. Due to closure size
  constraints, we can't really do that if NCG is available.
2025-09-11 15:45:26 +02:00
Emily
921f5db298 haskellPackages.llvmPackages: drop
There’s no sensible notion of a Haskell package set’s LLVM, only a
GHC’s LLVM. `haskellPackages.ghc.llvmPackages` is still accessible,
although you probably don’t actually want to use it very often.

Co-authored-by: sternenseemann <sternenseemann@systemli.org>
2025-09-11 15:13:56 +02:00
Wolfgang Walther
5a0711127c treewide: run nixfmt 1.0.0 2025-07-24 13:55:40 +02: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 a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00
Philip Taron
704677d109 haskellPackages: remove __attrsFailEvaluation, buildHaskellPackages, and generateOptparseApplicativeCompletions special cases 2024-07-04 15:28:48 -07:00
Armando Ramirez
876d055062 callCabal2nixWithOptions: add srcModifier argument
Fixes #256769

Repro + test of fix here: https://gitlab.com/ramirez7/bug-repros/-/merge_requests/1

Adds a `srcModifier` argument to `callCabal2nixWithOptions` to allow
customizing the source files used to generate the cabal file (e.g. to
support `hpack`/`package.yaml`).
2024-05-09 23:55:37 +02:00
Wolfgang Walther
747424168c haskell-modules: add revision argument to callHackageDirect
Previously, callHackageDirect was only able to fetch the first revision
of a package.

Resolves #134747
2024-02-11 19:02:59 +01:00
Adam Joseph
80472e3754 treewide: add __attrsFailEvaluation and __recurseIntoDerivationForReleaseJobs 2023-12-15 05:13:46 -08:00
sternenseemann
5ea114083c haskell.packages.ghc96.tls: fix missing LLVM tools on aarch64
The original change missed that we used to erroneously provide LLVM on
aarch64-linux, but not on aarch64-darwin which was later fixed
in #246045. Since the change was tested on aarch64-linux prior to this,
tls ended up being broken on both aarch64-linux and aarch64-darwin.

This commit resolves the situation by introducing a helper function to
achieve the effect of passing -fllvm while ensuring LLVM is provided.

Resolves #260013.
2023-10-22 19:18:13 +02:00
Lars Jellema
8af638e3d7 haskellPackages.ghcWithHoogle: Use overrides
ghcWithHoogle was using unoverridden packages pulled from the
buildHaskellPackages package set. This commit fixes that by pulling the
packages from self instead.
2023-06-14 14:28:08 +02:00
sternenseemann
391a9612d8 haskellPackages: ghcWithPackages needs buildHaskellPackages scope
ghc and also ghcWithPackages (when taken from a haskell package set) are
a bit weird—in the same way stdenv is: ghc is actually from
buildPackages (pkgsBuildHost) wheras the main package set belongs to
pkgsHostTarget. ghc (and stdenv) is included in the package set due to
its special relation to the set: it is built by that ghc, so constituted
by the compiler in a manner of speaking.

For ghc this works in a straightforward way: It is packaged
independently from the haskell package sets and passed to
make-package-set.nix to create the different sets we expose.
With ghcWithPackages an error crept in, though: Since it needs to
receive the haskellPackages fix point (and thus can't be instantiated
before the package set), it is defined in make-package-set.nix. Here it
was neglected to make sure that it also has the same scope as ghc, i.e.
buildHaskellPackages/buildPackages: Otherwise the shell the wrapper
scripts use to invoke ghc (originally from buildPackages) would be from
pkgsHostTarget—in the cross case, the wrapper scripts would be
executable by neither host nor build platform. We want them to work on
the build platform, though.

Note that this creates a weird mismatch where it is hard to see which of
the alternatives would be more natural: ghcWithPackages and
ghcWithHoogle now use packages from the package set they are a member
of, but have *-ghc and hoogle executables that are executable on the
build platform. This works because ghc originates from buildPackages (as
discussed) and hoogleWithPackages is taken from buildHaskellPackages.
This does imply though that while set.ghcWithHoogle will be executable
on the build platform, set.hoogleWithPackages will be executable on the
host platform—both will use the fix point of set for the package
selector function. This is maybe a confusing asymmetry, but it seems
like a valid use case to cross-compile a hoogle instance. Most
development tools use ghcWithHoogle (or equivalent), so that use case is
covered as well in principle.
2023-05-05 18:58:08 +02:00
Felix Buehler
cdb39a86e0 treewide: use optionalString 2023-02-13 21:52:34 +01:00
github-actions[bot]
259fe227c8 Merge master into haskell-updates 2022-12-19 00:12:05 +00:00
figsoda
ec8cb34358 treewide: fix typos 2022-12-17 19:39:44 -05:00
Naïm Favier
264178657f haskell.packages.ghc902.haskell-language-server: fix 2022-12-13 12:23:03 +01:00
Guillaume Bouchard
d1b6d2d0ab haskellPackages.callHackage: updating all-cabal-hashes do not invalidate callHackage
Packages built with `haskellPackages.callHackage` won't be rebuilt when
updating `all-cabal-hashes`.

The removed comment was keeping a reference to the `cabal2nix` call,
which itself depends on `all-cabal-hashes`, in order to keep this file
during a garbage collection.

The tradeoff is between:

- The current behavior: a mass rebuild, any change of `all-cabal-hashes`
  triggers a rebuild of all the packages built with `callHackage` and
  packages which depend on them. This can take hours, and may happen
  after a "small" unrelated change (i.e. an user is bumping
  `all-cabal-hashes` in order to use a new package from hackage). It
  also have global impacts in a project (long rebuild in CI, new entries
  in cache, developers need to fetch the new entries, ...). In this
  context, `cabal2nix` entries are not garbage collected.
- The new behavior: No mass rebuild, but `cabal2nix` derivations need to
  be recomputed after a garbage collection. This is usually fast (a few
  seconds by call), linear with the number of calls and should not
  happen a lot (i.e. users are not garbage collecting everyday).

See https://github.com/NixOS/nixpkgs/issues/194751 for details.
2022-11-26 19:00:56 +01:00
sternenseemann
ac1f1ad0e0 haskell: support cross in generateOptparseApplicativeCompletions
Deprecate haskell.lib{,.compose}.generateOptparseApplicativeCompletion*
in favor of the newly added
haskell.packages.*.generateOptparseApplicativeCompletions (plural!)
which takes into account whether we are cross-compiling or not. If we
are, generating completions is disabled, since we can't execute software
built for a different platform.

The move is necessary, so we can receive the /same/ stdenv as the
package we are overriding in order to accurately check whether we can
execute produced binaries.

Resolves #174040.
Resolves #49648.
2022-10-07 00:37:53 +02:00
github-actions[bot]
3aa744deb1 Merge master into haskell-updates 2022-08-26 00:15:32 +00:00
Alexander Vieth
f28ab51b54 haskell.lib.makePackageSet: all-cabal-hashes can be a directory (#188203)
* all-cabal-hahses can be a directory

Motivating problem: we want to use the flake.lock for all-cabal-hashes
as a github repository as our revision pin, and then import that to pass
as all-cabal-hashes. To do that we need it to accept a directory rather
than a tarball.

* all-cabal-hashes: add some comments
2022-08-24 20:57:52 -05:00
Robert Hensing
f89dd3dd4a haskellPackages.cabalSdist: Work around cabal#8413
See https://github.com/haskell/cabal/issues/8413
2022-08-22 12:12:09 +02:00
Martin Weinelt
d27e6f2d05 haskellPackages: Unalias RunCommandNoCCLocal 2022-06-29 21:26:45 +02:00
Robert Hensing
cf5e2d5103 haskellPackages: Add buildFromCabalSdist (faster, tested) 2022-05-23 22:28:57 +02:00
Robert Hensing
2e87d165f7 haskellPackages.shellFor: Add extraDependencies
An example use case is when you have Haskell scripts that use
libraries that don't occur in your packages' dependencies.
2022-03-15 20:38:22 +01:00
Robert Hensing
b4524d8eda haskellPackages.haskellSrc2nix: stdenvNoCC.mkDerivation -> runCommand
No need to fuss with phases.
2022-02-26 13:38:11 +01:00
Robert Hensing
46bb6a78db haskellPackages.callCabal2nix: Use stdenvNoCC
Delays C compiler realisation to the actual build, which is more
parallelizable; doesn't block the evaluator.
2022-02-26 13:28:12 +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
sternenseemann
baaf9459d6 haskellPackages.callPackage: support returning functions
Overrideable functions are possible by wrapping them as functors in an
attribute set first and appending the overrideScope and override
attributes later.
2022-01-06 12:21:45 +01:00
Ellie Hermaszewska
2413ab9e72 haskellPackages.developPackage: Use haskell.lib.compose correctly 2021-11-08 18:34:00 +08:00
Ellie Hermaszewska
15ae25f36c haskell: switch from haskell.lib to haskell.lib.compose 2021-11-07 20:18:45 +08:00
sternenseemann
5d53087f9b haskellPackages.callCabal2nixWithOptions: don't guess cabal filename
cabal only allows one cabal file per directory and cabal2nix will find
the correct file easily. Thus we don't need to know ahead of time which
cabal file to select. One downside of this is of course that we may
include unnecessary files in subdirectories, which could possibly be
fixed by enforcing depth.
2021-10-27 18:17:10 +02:00
Viacheslav Lotsmanov
707671dae2 haskellPackages.shellFor: Fix typo in the comments
“hpkgs” → “haskellPkgs”
2021-07-12 11:35:09 +09:00
Joe Hermaszewski
a3830da1aa haskell: default name to "" when root isn't a path in developPackage
See https://github.com/NixOS/nixpkgs/issues/103062
2021-05-08 18:22:54 +08:00
Dennis Gosnell
987b80a824 Merge pull request #109059 from jkachmar/haskell-generic-builder-args-modifier
Adds Haskell generic builder argument modifier
2021-01-27 22:37:41 +09:00
Ben Siraphob
2f78ee7e81 pkgs/development: stdenv.lib -> lib 2021-01-24 00:16:29 +07:00
Peter Simons
c3792f6cdd Consistently use 'lib' instead of 'stdenv.lib' in the Haskell infrastructure.
Part of https://github.com/NixOS/nixpkgs/issues/108938.
2021-01-22 20:34:21 +01:00
Joe Kachmar
95d0e6c1b8 Adds Haskell generic args builder documentation 2021-01-14 11:41:31 -05:00