Skip to content

Commit

Permalink
haskell: attempt at fixing the build
Browse files Browse the repository at this point in the history
  • Loading branch information
anpin committed Nov 26, 2024
1 parent b205acd commit 152fe35
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 62 deletions.
75 changes: 32 additions & 43 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,14 @@

inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
inputs.nixpkgs-stable.url = "github:nixos/nixpkgs/nixos-24.05";
inputs.nixpkgs-master.url = "github:nixos/nixpkgs/master";
inputs.flake-compat.url = "github:edolstra/flake-compat";
inputs.flake-compat.flake = false;
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.ihaskell.url = "github:ihaskell/ihaskell";
inputs.ihaskell.inputs.flake-utils.follows = "flake-utils";
inputs.ihaskell.inputs.nixpkgsMaster.follows = "nixpkgs-master";
inputs.ihaskell.inputs.nixpkgs24_05.follows = "nixpkgs-stable";
inputs.nix-dart.url = "github:djacu/nix-dart";
inputs.nix-dart.inputs.nixpkgs.follows = "nixpkgs";
inputs.nix-dart.inputs.flake-utils.follows = "flake-utils";
Expand Down
70 changes: 51 additions & 19 deletions modules/kernels/haskell/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
...
}: let
requiredRuntimePackages = [
config.nixpkgs.haskell.compiler.${config.haskellCompiler}
# config.nixpkgs.haskell.compiler.${config.haskellCompiler}
];
args = {inherit self system lib config name kernelName requiredRuntimePackages;};
kernelModule = import ./../../kernel.nix args;
Expand All @@ -36,30 +36,30 @@
env = haskellKernelPkg {
packages = extraHaskellPackages;
rtsopts = extraHaskellFlags;
extraEnvironmentBinaries = allRuntimePackages;
};

kernelspec = let
wrappedEnv =
pkgs.runCommand "wrapper-${env.name}"
{nativeBuildInputs = [pkgs.makeWrapper];}
''
mkdir -p $out/bin
for i in ${env}/bin/*; do
filename=$(basename $i)
ln -s ${env}/bin/$filename $out/bin/$filename
wrapProgram $out/bin/$filename \
--set PATH "${pkgs.lib.makeSearchPath "bin" allRuntimePackages}"
done
'';
in
wrappedEnv;
# kernelspec = let
# wrappedEnv =
# pkgs.runCommand "wrapper-${env.name}"
# {nativeBuildInputs = [pkgs.makeWrapper];}
# ''
# mkdir -p $out/bin
# for i in ${env}/bin/*; do
# filename=$(basename $i)
# ln -s ${env}/bin/$filename $out/bin/$filename
# wrapProgram $out/bin/$filename \
# --set PATH "${pkgs.lib.makeSearchPath "bin" allRuntimePackages}"
# done
# '';
# in
# wrappedEnv;
in
{
inherit name displayName;
inherit name displayName env;
language = "haskell";
# See https://github.com/IHaskell/IHaskell/pull/1191
# argv = kernelspec.argv ++ ["--codemirror" "Haskell"];
env = kernelspec;
# env = kernelspec;
codemirrorMode = "Haskell";
logo64 = ./logo-64x64.png;
}
Expand Down Expand Up @@ -118,6 +118,38 @@
(import (config.ihaskell + "/nix/overlay-9.8.nix"))
(import (config.ihaskell + "/nix/overlay-9.6.nix"))
(import (config.ihaskell + "/nix/overlay-9.10.nix"))
(sel: sup: {
haskell =
sup.haskell
// {
packages =
sup.haskell.packages
// {
ghc910 = sup.haskell.packages.ghc910.override {
overrides = self: super: {
# ghc-syntax-highlighter = self.ghc-syntax-highlighter;
# ghc-lib-parser = self.ghc-lib-parser_9_8_3_20241022;
# ghc-lib-parser-ex = self.ghc-lib-parser-ex_9_8_0_2;
ghc-syntax-highlighter = self.ghc-syntax-highlighter_0_0_12_0;
uuid-types = self.uuid-types_1_0_6;
uuid = self.uuid_1_3_16;
# https://github.com/ndmitchell/hlint/issues/1593
hlint =
self
.hlint_3_8
.overrideAttrs (old: {
src = sel.fetchFromGitHub {
owner = "ndmitchell";
repo = "hlint";
rev = "7aafde56f6bc526aedb95fb282d8fd2b4ea290cc";
sha256 = "sha256-B5aO6pec+Cpxelv7+Mlt1FWjLGwsQCXI0thjCMpXqeE=";
};
});
};
};
};
};
})
])
.callPackage "${config.ihaskell}/nix/release.nix" {
compiler = config.haskellCompiler;
Expand Down

0 comments on commit 152fe35

Please sign in to comment.