!RbXGJhHMsnQcNIDFWN:nixos.org

Haskell in Nixpkgs/NixOS

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

Load older messages


SenderMessageTime
5 Jul 2025
@sternenseemann:systemli.orgsterni (he/him) alexfmpe: haskell.packageOverrides 23:57:26
@sternenseemann:systemli.orgsterni (he/him) 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.org@dmjio:matrix.org

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.org@dmjio:matrix.org

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.org@dmjio:matrix.org does fetchFromFlakeLock already exist somewhere 19:51:18
@dmjio:matrix.org@dmjio:matrix.orgokay will check it out, we'll see19:54:50
@dmjio:matrix.org@dmjio:matrix.org Also, is there a way to generate a flake.nix on the fly, similar to how callCabal2nix works 19:55:07
@dmjio:matrix.org@dmjio:matrix.orgnot all my repos have flakes and I'd have to add it to each one basically19:55:29
@dmjio:matrix.org@dmjio:matrix.org but I'm going to just override the nixpkgs with nixpkgs.follows anyways 19:55:39
@dmjio:matrix.org@dmjio:matrix.orgotherwise the flakes will be mutually recursive20:02:12
@dmjio:matrix.org@dmjio:matrix.org* otherwise the flakes will be mutually recursive (some of them)20:02:23
@dmjio:matrix.org@dmjio:matrix.org Also 21:19:51
@dmjio:matrix.org@dmjio:matrix.org Who is the CEO of Flakeroku 21:19:57
@dmjio:matrix.org@dmjio:matrix.org What is the flake heroku equivalent 21:20:15
@sellout:matrix.orgselloutI’m having a hell of a time caching this one project, I think it must be related to Haskell / IFD. I follow the Cachix instructions for caching build & runtime deps (https://docs.cachix.org/pushing#pushing-build-and-runtime-dependencies), I do that on all three supported systems, and then I expect in this CI run (https://github.com/sellout/unison/actions/runs/16144540250), that it won’t have to build anything. But that’s never what happens. You can see the two macOS runs are 2-3 hours, and the linux one gets “canceled” for some reason I can’t deduce (but not before trying to build a ton of stuff). It’s on this branch (https://github.com/sellout/unison/tree/update-nix), but I feel like I run into this every time I update Nix at all. When I run it on a different machine locally, I just see “evaluating derivation '…#all'” for ages before anything else happens, which is what makes me think it’s IFD.22:58:47
@vigress9:matrix.org@vigress9:matrix.org left the room.23:21:02
9 Jul 2025
@jonhermansen:matrix.orgjonhermansen joined the room.01:18:54
@prsteele:matrix.orgPatrick Steele Does anyone have an example of how to structure a flake to allow builds to run with profiling enabled? If I add -prof to my cabal file, I get Failed to load dynamic interface file for Prelude errors, even in a simple project with no dependencies. 02:18:05

Show newer messages


Back to Room ListRoom Version: 6