input-output-hk / haskell.nix

Alternative Haskell Infrastructure for Nixpkgs
https://input-output-hk.github.io/haskell.nix
Apache License 2.0
556 stars 240 forks source link

Generate `default-lts-X.Y.nix` expression #1691

Closed angerman closed 2 years ago

angerman commented 6 years ago

When generating the nix expression from the stack.yaml, we should also generate

let

  stack-pkgs = import ./stack-pkgs.nix;

  overlay = self: super: {
    haskellPackages = (import <stackage>).lts-9_1
      { extraDeps = hsPkgs: (stack-pkgs.extraDeps hsPkgs
                          // stack-pkgs.packages hsPkgs); };
  };

  pkgs = import <nixpkgs> { overlays = [ overlay ]; };

in with pkgs.haskellPackages;
# pkgs.lib.mapAttrs (_: x: callPackage x {})
pkgs.haskellPackages.override {
  overrides = self: super: {
    # FIXME: this doesn't work yet. Overridable logic
    #        is missing.
  };
}

along with it.

That will however break the stdout dump. So Stack2Nix would generate both the pkgset and this expression... Or dump this expression, and generate the current nix-expression in .stack.nix?

angerman commented 6 years ago

The same logic can be used with plan-to-nix; there is still a bit too much boilerplate around for my taste.

hamishmack commented 2 years ago

I think this issue is more or less obsolete.