Skip to content

Instantly share code, notes, and snippets.

@puffnfresh
Last active June 14, 2019 05:49
Show Gist options
  • Save puffnfresh/903b399d1e3ace6bf7258917def96d9b to your computer and use it in GitHub Desktop.
Save puffnfresh/903b399d1e3ace6bf7258917def96d9b to your computer and use it in GitHub Desktop.

Revisions

  1. puffnfresh revised this gist Jun 14, 2019. 2 changed files with 3 additions and 19 deletions.
    7 changes: 3 additions & 4 deletions default.nix
    Original file line number Diff line number Diff line change
    @@ -1,10 +1,8 @@
    { pkgs ? import <nixpkgs> {} }:

    let
    haskell = import ./haskell.nix { inherit pkgs; };
    haskell = import (builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/master.tar.gz) { inherit pkgs; };

    # some sort of problem with datadir being wrong
    # same error as https://github.com/haskell/cabal/issues/5867
    happyHack = config:
    let inherit (config.hsPkgs) happy;
    in "export happy_datadir=${happy.components.exes.happy}/share/${builtins.currentSystem}-ghc-${config.compiler.version}/${happy.identifier.name}-${happy.identifier.version}";
    @@ -15,7 +13,8 @@ let
    ({ config, ... }:
    { packages.haskell-src.preBuild = happyHack config;
    packages.pretty-show.preBuild = happyHack config;
    })
    nonReinstallablePkgs = [ "ghc" "ghc-boot" "ghci" "binary" "bytestring" "containers" "directory" "filepath" "hpc" "process" "time" "terminfo" "transformers" "unix" ];
    })
    ];
    };

    15 changes: 0 additions & 15 deletions haskell.nix.patch
    Original file line number Diff line number Diff line change
    @@ -1,15 +0,0 @@
    diff --git a/modules/component-driver.nix b/modules/component-driver.nix
    index e957cdf..81571c6 100644
    --- a/modules/component-driver.nix
    +++ b/modules/component-driver.nix
    @@ -34,7 +34,9 @@ in

    config.nonReinstallablePkgs =
    [ "rts" "ghc-heap" "ghc-prim" "integer-gmp" "integer-simple" "base"
    - "deepseq" "array" "ghc-boot-th" "pretty" "template-haskell" ];
    + "deepseq" "array" "ghc-boot-th" "pretty" "template-haskell"
    + "ghc" "ghc-boot" "ghci"
    + "binary" "bytestring" "containers" "directory" "filepath" "hpc" "process" "time" "terminfo" "transformers" "unix" ];

    options.hsPkgs = lib.mkOption {
    type = lib.types.unspecified;
  2. puffnfresh revised this gist Jun 13, 2019. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions default.nix
    Original file line number Diff line number Diff line change
    @@ -3,6 +3,8 @@
    let
    haskell = import ./haskell.nix { inherit pkgs; };

    # some sort of problem with datadir being wrong
    # same error as https://github.com/haskell/cabal/issues/5867
    happyHack = config:
    let inherit (config.hsPkgs) happy;
    in "export happy_datadir=${happy.components.exes.happy}/share/${builtins.currentSystem}-ghc-${config.compiler.version}/${happy.identifier.name}-${happy.identifier.version}";
  3. puffnfresh revised this gist Jun 13, 2019. 1 changed file with 21 additions and 0 deletions.
    21 changes: 21 additions & 0 deletions default.nix
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,21 @@
    { pkgs ? import <nixpkgs> {} }:

    let
    haskell = import ./haskell.nix { inherit pkgs; };

    happyHack = config:
    let inherit (config.hsPkgs) happy;
    in "export happy_datadir=${happy.components.exes.happy}/share/${builtins.currentSystem}-ghc-${config.compiler.version}/${happy.identifier.name}-${happy.identifier.version}";

    pkgSet = haskell.mkCabalProjectPkgSet {
    plan-pkgs = import ./pkgs.nix;
    modules = [
    ({ config, ... }:
    { packages.haskell-src.preBuild = happyHack config;
    packages.pretty-show.preBuild = happyHack config;
    })
    ];
    };

    in
    pkgSet.config.hsPkgs
  4. puffnfresh created this gist Jun 13, 2019.
    15 changes: 15 additions & 0 deletions haskell.nix.patch
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    diff --git a/modules/component-driver.nix b/modules/component-driver.nix
    index e957cdf..81571c6 100644
    --- a/modules/component-driver.nix
    +++ b/modules/component-driver.nix
    @@ -34,7 +34,9 @@ in

    config.nonReinstallablePkgs =
    [ "rts" "ghc-heap" "ghc-prim" "integer-gmp" "integer-simple" "base"
    - "deepseq" "array" "ghc-boot-th" "pretty" "template-haskell" ];
    + "deepseq" "array" "ghc-boot-th" "pretty" "template-haskell"
    + "ghc" "ghc-boot" "ghci"
    + "binary" "bytestring" "containers" "directory" "filepath" "hpc" "process" "time" "terminfo" "transformers" "unix" ];

    options.hsPkgs = lib.mkOption {
    type = lib.types.unspecified;