!RbXGJhHMsnQcNIDFWN:nixos.org

Haskell in Nixpkgs/NixOS

660 Members
For discussions and questions about Haskell with Nix, cabal2nix and haskellPackages in nixpkgs | Current Docs: https://nixos.org/manual/nixpkgs/unstable/#haskell | Current PR: https://github.com/nixos/nixpkgs/pulls?q=is%3Apr+is%3Aopen+head%3Ahaskell-updates | Maintainer Docs: https://github.com/NixOS/nixpkgs/blob/haskell-updates/pkgs/development/haskell-modules/HACKING.md | More Nix: #community:nixos.org | More Haskell: #haskell-space:matrix.org | Merger Schedule: https://cloud.maralorn.de/apps/calendar/p/H6migHmKX7xHoTFa/dayGridMonth/now | Join #haskell.nix:libera.chat for question about the alternative haskell.nix infrastructure132 Servers

Load older messages


SenderMessageTime
4 Jul 2025
@collinarnett:matrix.orgCollin Arnett How can I get the haddoc html files for dependencies of my project when using shellFor? I have doHaddoc turned on for my dependencies. 18:35:27
@alexfmpe:matrix.orgalexfmpeIt's on by default I think?19:35:28
@alexfmpe:matrix.orgalexfmpeEasiest way is to run hoogle locally19:35:41
@alexfmpe:matrix.orgalexfmpehoogle server --local -p 808019:36:18
@alexfmpe:matrix.orgalexfmpemight need withHoogle = true, don't remember if default in shellFor19:36:48
@collinarnett:matrix.orgCollin ArnettDoes the hoogle server serve the haddocs as well? I'm not really sure what I'm looking for so I would like to browse the docs like I would on hackage.20:44:03
@collinarnett:matrix.orgCollin ArnettOh I see it does link them locally after you click on the package from hoogle. Thank you :D20:49:02
5 Jul 2025
@alexfmpe:matrix.orgalexfmpe is there a way for a nixpkgs-using project to apply an override to all haskell.packages.ghc123 like configuration-common.nix do?
or do we always need the nixpkgs.haskell.packages.${version} override cascade ?
20:20:02
@sternenseemann:systemli.orgsterni alexfmpe: haskell.packageOverrides 23:57:26
@sternenseemann:systemli.orgsterni which is the default argument for overrides passed to any specific package set, so you can't use that to further extend without doing that explicitly 23:57:57
6 Jul 2025
@alexfmpe:matrix.orgalexfmpeah damn actually this one time in particular I want the specific version thing00:05:26
@alexfmpe:matrix.orgalexfmpebecause I'm messing with a boot package00:05:39
@alexfmpe:matrix.orgalexfmpeso using packageOverrides rebuilds the world00:05:54
@alex:tunstall.xyzAlex
In reply to @alexfmpe:matrix.org
might need withHoogle = true, don't remember if default in shellFor
Not default, unless it has changed recently.
00:10:58
@alexfmpe:matrix.orgalexfmpeindeed00:12:02
@alexfmpe:matrix.orgalexfmpehttps://github.com/NixOS/nixpkgs/blob/a697a033bd07502703b151797085e5c7b64c6f31/pkgs/development/haskell-modules/make-package-set.nix#L45300:12:03
@alex:tunstall.xyzAlex
In reply to @collinarnett:matrix.org
Does the hoogle server serve the haddocs as well? I'm not really sure what I'm looking for so I would like to browse the docs like I would on hackage.
Note that how Hoogle serves Haddocks is affected by the --local flag.
(For most users, running with --local works better.)
See https://github.com/ndmitchell/hoogle/blob/e83646ee1b62eb724def6c838a34017b60fc519a/docs/Install.md#server
00:14:08
@woobilicious:matrix.orgwoobiliciousIs there anyway to "export" a build plan for haskell apps based on the nixpkgs version? trying to think how to compile my code for windows, and cabal obvious isn't going to pull in the exact same versions without some hints. I guess I could look at cross compiling using mingw64 version of ghc in nixpkgs, but that might just be a huge headache.05:56:37
@alex:tunstall.xyzAlex
In reply to @woobilicious:matrix.org
Is there anyway to "export" a build plan for haskell apps based on the nixpkgs version? trying to think how to compile my code for windows, and cabal obvious isn't going to pull in the exact same versions without some hints. I guess I could look at cross compiling using mingw64 version of ghc in nixpkgs, but that might just be a huge headache.
Have you tried cabal freeze?
06:23:48
@woobilicious:matrix.orgwoobiliciousoh thanks, I didn't realise that existed...kinda half forgot cabal added some modern features, as I used to use stack on windows and nixpkgs now.06:44:58
8 Jul 2025
@dmjio:matrix.orgdmjio

is there a function to parse a flake lockfile into a set?

let sources = parseFlakeLock (builtins.readFile ./flake.lock);

something like this

16:07:35
@ners:nixos.devnersYes, in fact flake-compat is based on this principle. See examples here: https://github.com/nix-community/flake-compat16:13:58
@ners:nixos.devners *

Yes, in fact flake-compat is based on this principle. See examples here: https://github.com/nix-community/flake-compat

Basically: builtins.fromJSON (builtins.readFile ./flake.lock);

16:14:48
@dmjio:matrix.orgdmjio

so I'm just doing this rn

  # fetch from flake.lock
  with (builtins.fromJSON (builtins.readFile ../flake.lock));
  fetchFromFlakeLock = args:
    fetchFromGitHub {
      inherit (args.locked) owner repo rev;
      hash = args.locked.narHash;
    };
  servant = fetchFromFlake (nodes.servant);
19:50:58
@dmjio:matrix.orgdmjio does fetchFromFlakeLock already exist somewhere 19:51:18
@dmjio:matrix.orgdmjiookay will check it out, we'll see19:54:50
@dmjio:matrix.orgdmjio Also, is there a way to generate a flake.nix on the fly, similar to how callCabal2nix works 19:55:07
@dmjio:matrix.orgdmjionot all my repos have flakes and I'd have to add it to each one basically19:55:29
@dmjio:matrix.orgdmjio but I'm going to just override the nixpkgs with nixpkgs.follows anyways 19:55:39
@dmjio:matrix.orgdmjiootherwise the flakes will be mutually recursive20:02:12

Show newer messages


Back to Room ListRoom Version: 6