!RbXGJhHMsnQcNIDFWN:nixos.org

Haskell in Nixpkgs/NixOS

728 Members
For discussions and questions about Haskell with Nix, cabal2nix and haskellPackages in nixpkgs | Current Docs: https://haskell4nix.readthedocs.io/ | More Nix: #community:nixos.org | More Haskell: #haskell-space:matrix.org146 Servers

Load older messages


SenderMessageTime
15 Dec 2024
@alexfmpe:matrix.orgalexfmpeBecause it only became a de facto dependency after you activated the config that declared it18:53:42
@alexfmpe:matrix.orgalexfmpeSo I'd need to build twice. One to switch to a new dep and another to use it18:54:05
@alexfmpe:matrix.orgalexfmpeFound this out the hard way when trying to do some trivial edit months after and now being unable to build18:55:24
@alexfmpe:matrix.orgalexfmpeBecause the first activation had put me on a newer nixpkgs but not yet tried to build 18:56:03
@sternenseemann:systemli.orgsterni (he/him)https://hydra.nixos.org/eval/181050419:06:25
@megmug:matrix.org@megmug:matrix.org alexfmpe: I tried out direnv and it works now - thank you! 19:45:22
16 Dec 2024
@feet-wind:matrix.org@feet-wind:matrix.org removed their display name feet-wind.05:36:02
@feet-wind:matrix.org@feet-wind:matrix.org left the room.05:36:05
@dithpri:matrix.orgdithpri joined the room.18:29:13
@hellwolf:matrix.orghellwolf9️⃣🔹1️⃣2️⃣20:58:24
@hellwolf:matrix.orghellwolf🎄20:58:48
@sternenseemann:systemli.orgsterni (he/him)I'll push that tomorrow I think22:07:48
@sternenseemann:systemli.orgsterni (he/him)Hadrian has weird bounds issues again22:07:53
@hellwolf:matrix.orghellwolfs/sterni/santa/22:17:12
17 Dec 2024
@mequbic:matrix.orgiqubic (she/her)

So, I'm using the following shell.nix for a a Haskell project of mine. The project is my Advent of Code solutions. This is using using cabal2nix to fetch the dependencies. I would like to use the Hackage package sbv in this project, however the latest version of sbv in Nixpkgs is 10.2, which is refusing to build. Hackage shows that later versions of the package, like 11.0, do exist. Is there some way I can modify my shell.nix to get a newer version of this package?

{ pkgs ? import <nixpkgs> {} }:
let
  src = pkgs.nix-gitignore.gitignoreSource [] ./.;
  myPkg = pkgs.haskellPackages.callCabal2nix "aoc24" src {};
in
pkgs.stdenv.mkDerivation {
  name = "aoc-shell";

  buildInputs = [
    myPkg.env.nativeBuildInputs

    pkgs.haskell-language-server
    pkgs.cabal-install
    pkgs.hlint
  ];
}
07:39:13
@maralorn:maralorn.demaralorn"Refusing to build"?07:40:40
@mequbic:matrix.orgiqubic (she/her)It's marked as broken. 07:41:44
@mequbic:matrix.orgiqubic (she/her)https://dpaste.com/7KUW6R7PA07:41:45
@mequbic:matrix.orgiqubic (she/her)So Nix is refusing to evaluate it.07:42:03
@maralorn:maralorn.demaralornWell disabling that broken flag is probably a slight bit easier than swapping for a newer version.07:43:33
@mequbic:matrix.orgiqubic (she/her)How can I do that?07:44:01
@maralorn:maralorn.demaralornEitherway you will need to apply an overlay to pkgs.haskellPackages in line 4.07:44:46
@mequbic:matrix.orgiqubic (she/her)That sounds a bit tricky.07:45:29
@maralorn:maralorn.demaralornIt's not so hard if you have an example. Sadly I am on my phone and I have to run.07:47:38
@mequbic:matrix.orgiqubic (she/her)I see.07:47:45
@mequbic:matrix.orgiqubic (she/her)I might be able to find an example in an older project of mine.07:47:56
@mequbic:matrix.orgiqubic (she/her)Nope... Not finding any examples in my past projects.07:52:33
@me:linj.techlinj

overlays.default = final: prev: {
        haskellPackages = prev.haskellPackages.override (args: {
          overrides = final.lib.composeExtensions args.overrides (
            let
              hlib = final.haskell.lib.compose;
            in
            hfinal: hprev: {
              hid-examples =
                let
                  # filter out haskell-unrelated files to avoid unnecessary rebuilds
                  src = builtins.path {
                    path = ./.;
                    # NOTE setting name is important because the default one contains
                    # the store path of this flake, which defeats the motivation
                    name = "source";
                    filter =
                      path: type:
                      !builtins.elem (builtins.baseNameOf path) [
                        "flake.nix"
                        "flake.lock"
                        ".envrc"
                      ];
                  };
                in
                hfinal.callCabal2nix "hid-examples" src { };
              colonnade = final.lib.pipe hprev.colonnade [
                hlib.markUnbroken
                (hlib.overrideCabal (args': {
                  # https://github.com/byteverse/colonnade/issues/31
                  doCheck = if args'.version == "1.2.0.2" then false else true;
                }))
              ];
              streaming-utils = final.lib.pipe hprev.streaming-utils [
                hlib.markUnbroken
                (hlib.overrideCabal (args': {
                  # Error: Setup: Encountered missing or private dependencies:
                  # resourcet >1.0 && <1.3
                  jailbreak = if args'.version == "0.2.5.0" then true else false;
                }))
              ];
            }
          );
        });
      };

07:56:52
@me:linj.techlinj *

overlays.default = final: prev: {
        haskellPackages = prev.haskellPackages.override (args: {
          overrides = final.lib.composeExtensions args.overrides (
            let
              hlib = final.haskell.lib.compose;
            in
            hfinal: hprev: {
              colonnade = final.lib.pipe hprev.colonnade [
                hlib.markUnbroken
                (hlib.overrideCabal (args': {
                  # https://github.com/byteverse/colonnade/issues/31
                  doCheck = if args'.version == "1.2.0.2" then false else true;
                }))
              ];
              streaming-utils = final.lib.pipe hprev.streaming-utils [
                hlib.markUnbroken
                (hlib.overrideCabal (args': {
                  # Error: Setup: Encountered missing or private dependencies:
                  # resourcet >1.0 && <1.3
                  jailbreak = if args'.version == "0.2.5.0" then true else false;
                }))
              ];
            }
          );
        });
      };

07:57:19
@me:linj.techlinj *

      final: prev: {
        haskellPackages = prev.haskellPackages.override (args: {
          overrides = final.lib.composeExtensions args.overrides (
            let
              hlib = final.haskell.lib.compose;
            in
            hfinal: hprev: {
              colonnade = final.lib.pipe hprev.colonnade [
                hlib.markUnbroken
                (hlib.overrideCabal (args': {
                  # https://github.com/byteverse/colonnade/issues/31
                  doCheck = if args'.version == "1.2.0.2" then false else true;
                }))
              ];
              streaming-utils = final.lib.pipe hprev.streaming-utils [
                hlib.markUnbroken
                (hlib.overrideCabal (args': {
                  # Error: Setup: Encountered missing or private dependencies:
                  # resourcet >1.0 && <1.3
                  jailbreak = if args'.version == "0.2.5.0" then true else false;
                }))
              ];
            }
          );
        });
      };

07:58:03

Show newer messages


Back to Room ListRoom Version: 6