!RbXGJhHMsnQcNIDFWN:nixos.org

Haskell in Nixpkgs/NixOS

698 Members
For discussions and questions about Haskell with Nix, cabal2nix and haskellPackages in nixpkgs | Current Docs: https://haskell4nix.readthedocs.io/140 Servers

Load older messages


SenderMessageTime
2 May 2025
@sternenseemann:systemli.orgsternialmost certainly13:13:02
@teoc:matrix.orgteo (they/he)I looked into this at some point and iirc if you don't specify a component it installs everything including private libs but if you specify a component with buildTarget then it does the right thing14:20:45
@teoc:matrix.orgteo (they/he)At least as far as Setup.hs is concerned14:22:09
@malteneuss:matrix.org@malteneuss:matrix.org left the room.18:53:19
@hellwolf:matrix.orghellwolfwhat a great tool, thanks ! :)22:01:23
3 May 2025
@sternenseemann:systemli.orgsterni teo (they/he): I think we'll just need to start generating a list of components to install from the cabal file and pass it to mkDerivation or something 14:18:39
@sternenseemann:systemli.orgsterni maybe replace the isLibrary, isExecutable logic altogether which is a little brittle 14:19:22
4 May 2025
@woobilicious:matrix.orgwoobilicioushow would one statically compile all deps (except libc)? with just ghc directly? I guess my current issue is that pkgsStatic.ghc.withPackages is missing.03:38:02
@woobilicious:matrix.orgwoobilicious
❯  nix shell --impure --expr "(import (builtins.getFlake \"nixpkgs\") {}).pkgsStatic.haskellPackages.shellFor { packages = (p: [ p.aeson p.typed-process p.bytestring p.lens p.lens-aeson]);}"
error:
       … while calling a functor (an attribute set with a '__functor' attribute)
         at /nix/store/s8b6phy15mzjvx56vjdd1rdd8hr07qw5-source/pkgs/development/haskell-modules/make-package-set.nix:613:29:
          612|       # pkgWithCombinedDeps :: HaskellDerivation
          613|       pkgWithCombinedDeps = self.mkDerivation (genericBuilderArgsModifier genericBuilderArgs);
             |                             ^
          614|

       … while evaluating a branch condition
         at /nix/store/s8b6phy15mzjvx56vjdd1rdd8hr07qw5-source/lib/customisation.nix:173:7:
          172|       in
          173|       if isAttrs result then
             |       ^
          174|         result

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: expected a set but found null: null

03:47:32
@sternenseemann:systemli.orgsterni woobilicious: does it evaluate if you remove p.bytestring from the list? 08:54:55
@alex:tunstall.xyzAlex
In reply to @woobilicious:matrix.org
❯  nix shell --impure --expr "(import (builtins.getFlake \"nixpkgs\") {}).pkgsStatic.haskellPackages.shellFor { packages = (p: [ p.aeson p.typed-process p.bytestring p.lens p.lens-aeson]);}"
error:
       … while calling a functor (an attribute set with a '__functor' attribute)
         at /nix/store/s8b6phy15mzjvx56vjdd1rdd8hr07qw5-source/pkgs/development/haskell-modules/make-package-set.nix:613:29:
          612|       # pkgWithCombinedDeps :: HaskellDerivation
          613|       pkgWithCombinedDeps = self.mkDerivation (genericBuilderArgsModifier genericBuilderArgs);
             |                             ^
          614|

       … while evaluating a branch condition
         at /nix/store/s8b6phy15mzjvx56vjdd1rdd8hr07qw5-source/lib/customisation.nix:173:7:
          172|       in
          173|       if isAttrs result then
             |       ^
          174|         result

       (stack trace truncated; use '--show-trace' to show the full, detailed trace)

       error: expected a set but found null: null

  1. I think you misunderstand the inputs for shellFor. The packages input should be the packages you're developing. shellFor won't install them, only their dependencies.
  2. pkgsStatic usually requires cross-compilation. If you run into evaluation or build problems, this is probably why.
  3. bytestring is a boot library preinstalled with GHC, so Nixpkgs sets it to null (this is why sterni has suggested you remove it).
  4. For smaller outputs, consider also using justStaticExecutables.
09:40:04
@sternenseemann:systemli.orgsterni GHC 9.10.2 ships text 2.1.2 so we have all the annoying show breakage from 9.12 also there now 10:06:31
@woobilicious:matrix.orgwoobiliciousAhh okay, Yeah I just want ghc, I don't have a package at the moment.11:27:35
@woobilicious:matrix.orgwoobiliciousRemoving bytestring allowed it to eval, so that explains it.11:29:29
5 May 2025
@maralorn:maralorn.demaralorndefault ghc 9.8 has reached master and is heading for nixos-unstable. 🎉08:08:28
@maralorn:maralorn.demaralornArgh, my server seems to be replaying the event history in this room …09:39:42
@googleson78:tryp.io@googleson78:tryp.io left the room.15:00:30
@vcunat:matrix.orgvcunatI canceled https://hydra.nixos.org/jobset/nixpkgs/haskell-updates for now, until we catch up with the staging-next merge. Hydra has 400k long queue now. While most of that's cached, it takes time. And building the haskell jobset could slow it significantly, I think. (it really was building already)15:03:22
6 May 2025
@caina:caina.io彩娜 🏳️‍⚧️ joined the room.03:06:34
@vcunat:matrix.orgvcunatIt's much better now. Restarted the jobs.05:11:45
@alist:matrix.orgyliceee joined the room.07:46:49
@alist:matrix.orgyliceeedoes anyone have an example of a nix flake which uses haskell-flake and installs bash completions with the package? 07:47:14
@maralorn:maralorn.demaralorn

λlice: Do you mean generating completion for optparse applicative parameters? There is a helper for that in nixpkgs, but I don’t know how to integrate it with haskell-flake.

There might be other venues, where there is more discussion about haskell-flake, the readme is e.g. linking a zulip, since the maintainer of haskell-flake is banned from nixos community rooms.

07:54:59
@alist:matrix.orgyliceeeyeah i mean im not particularly eager to interact with the dev07:55:37
@alist:matrix.orgyliceeebut yes that's exactly my usecase. could u link the helper?07:56:14
@maralorn:maralorn.demaralornhttps://nixos.org/manual/nixpkgs/unstable/#haskell-package-set-lib-functions07:58:15
@maralorn:maralorn.demaralornThe ominously named file "haskell-modules/configuration-nix.nix" somewhere in nixpkgs contains plenty usage examples.07:59:19
@alist:matrix.orgyliceeetysm !07:59:57
@oak:universumi.fioak 🏳️‍🌈♥️ Could I get invite to #users:nixos.org channel please? 08:40:53
@alist:matrix.orgyliceeeoh, is that why i can't join the new version? it's invite-only now?09:12:17

Show newer messages


Back to Room ListRoom Version: 6