4 Jul 2025 |
Collin 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 | It's on by default I think? | 19:35:28 |
alexfmpe | Easiest way is to run hoogle locally | 19:35:41 |
alexfmpe | hoogle server --local -p 8080 | 19:36:18 |
alexfmpe | might need withHoogle = true, don't remember if default in shellFor | 19:36:48 |
Collin Arnett | 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. | 20:44:03 |
Collin Arnett | Oh I see it does link them locally after you click on the package from hoogle. Thank you :D | 20:49:02 |
5 Jul 2025 |
alexfmpe | 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 |
sterni | alexfmpe: haskell.packageOverrides | 23:57:26 |
sterni | 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 | ah damn actually this one time in particular I want the specific version thing | 00:05:26 |
alexfmpe | because I'm messing with a boot package | 00:05:39 |
alexfmpe | so using packageOverrides rebuilds the world | 00:05:54 |
Alex | 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 | indeed | 00:12:02 |
alexfmpe | https://github.com/NixOS/nixpkgs/blob/a697a033bd07502703b151797085e5c7b64c6f31/pkgs/development/haskell-modules/make-package-set.nix#L453 | 00:12:03 |
Alex | 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 | 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. | 05:56:37 |
Alex | 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 | oh 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 | 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 | Yes, in fact flake-compat is based on this principle. See examples here: https://github.com/nix-community/flake-compat | 16:13:58 |
ners | * 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 | 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 | does fetchFromFlakeLock already exist somewhere | 19:51:18 |
dmjio | okay will check it out, we'll see | 19:54:50 |
dmjio | Also, is there a way to generate a flake.nix on the fly, similar to how callCabal2nix works | 19:55:07 |
dmjio | not all my repos have flakes and I'd have to add it to each one basically | 19:55:29 |
dmjio | but I'm going to just override the nixpkgs with nixpkgs.follows anyways | 19:55:39 |
dmjio | otherwise the flakes will be mutually recursive | 20:02:12 |