IHaskell / IHaskell

A Haskell kernel for the Jupyter project.
MIT License
2.59k stars 257 forks source link

IHaskell.Display.Widgets not available when using Nix packages #1424

Closed aneilmac closed 11 months ago

aneilmac commented 12 months ago

Hi there,

AFAIK, there is currently no way to access widgets functionality when using a Nix workflow.

Currently I have a repl.it setup like so:

{ pkgs }:
let
  ihaskell =
    pkgs.ihaskell.override { packages = (hpkgs: [ hpkgs.ihaskell-widgets ]); };
in { deps = [ ihaskell ]; }

But as the widgets library on hackage is outdated this project will not build.

If possible, could you please update the ihaskell-widgets package on hackage/nixos.org such that widgets can be used in a nix workflow? (Or alternatively, a display: true flag that can be enabled to activate all the bells and whistles?)

Thanks for all your hard work on this.

vaibhavsagar commented 12 months ago

You can use the .nix files in this repo to set that up using something like this:

let
  nixpkgs = builtins.fetchTarball {
    url = "https://github.com/NixOS/nixpkgs/tarball/${rev}";
    sha256 = "0a0dnbsbblh4wps0lzzxv3gfphscv6bqjc77lkr58xkzcijjdlv2";
  };
  ihaskell = builtins.fetchTarball {
    url = "https://github.com/IHaskell/IHaskell/tarball/${rev}";
    sha256 = "1k4ljp7fnrswq055lqjz25c45gi1nkxrs4mh4fx0wv6lxi0i6zxa";
  };
in import "${ihaskell}/release.nix" {
  compiler = "ghc928";
  nixpkgs  = import nixpkgs {};
  packages = self: with self; [ ihaskell-widgets ];
}
vaibhavsagar commented 11 months ago

I've uploaded [ihaskell-widgets-0.4.0.0](https://hackage.haskell.org/package/ihaskell-widgets-0.4.0.0). Getting it updated on Stackage and Nixpkgs is a separate matter, but since you can use the approach above or pull it directly from Hackage, I think I can close this. Please reopen if required.

aneilmac commented 10 months ago

Sorry for the delay - the change has made its way over into repl now, and I just wanted to say thank you very much, it works like a charm now.