!RbXGJhHMsnQcNIDFWN:nixos.org

Haskell in Nixpkgs/NixOS

751 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.org150 Servers

Load older messages


SenderMessageTime
30 Apr 2026
@winston:winston.shwinston heya, I only just saw the recent-ish merge of the microhs changes, thanks for the work on that! ❤️
I think I've read up on the PR, but will hugs be the way microhs is getting build in the foreseeable future? I'm trying to add an override to get the mhseval binary to build, and was trying to understand the build process. Am I seeing this correctly that building with hugs currently closes off the possibility of building mhseval/mhseval.js?
https://github.com/augustss/MicroHs/blob/master/mhs/MhsEval.hs
22:54:07
@alex:tunstall.xyzAlex

Yes, building with Hugs is currently the preferred way because it does not depend on any pre-generated code.
The stage 1 build uses a pre-existing mhs (usually runhugs wrapped mhs) with make.
The stage 2 build uses the stage 1 mhs with mcabal.

It's not immediately obvious to me how exactly mhseval.js is generated, but is there any reason you can't generate it using the stage 1 or stage 2 compiler?

23:37:10
@alex:tunstall.xyzAlexSince it seems to be a separate output, I would recommend using a different derivation instead of overriding the existing ones.23:39:01
@winston:winston.shwinston

I was trying to get it to work via

mhseval = pkgs.haskell.compiler.microhs.overrideAttrs (prevAttrs: {
  microhs-stage1 = prevAttrs.passthru.microhs-stage1.overrideAttrs {
    nativeBuildInputs = [ pkgs.breakpointHook ];
    postBuild = ''
      make bin/mhseval
    '';
    postInstall = ''
      cp bin/mhseval $out/bin/mhseval
    '';
  };
});

and didn't manage to get a useful output that way, I did try to copy it from stage1 to stage2 later, but I've changed a bunch of code around this

23:39:42
@winston:winston.shwinston currently I'm just doing a mkDerivation inheriting from src etc from pkgs.haskell.compiler.microhs, then postInstall'ing mhseval, so that works 23:40:24
@alex:tunstall.xyzAlex Is your ultimate desired hostPlatform one of the JS platforms? 23:40:37
@winston:winston.shwinstonnot doing JS at the minute, so I haven't tried that yet, I just anticipate that there'll be some interest for that as well23:41:07
@alex:tunstall.xyzAlex The other problem here is that mhseval is not in the Cabal file, so naturally the stage 2 build won't include it either. 23:48:31
@alex:tunstall.xyzAlex Unless JS is supported as a buildPlatform, I think it might be best to first make microhs compatible with cross.
I'm not sure what's missing for cross, but I suspect it has to do with the targetPlatform not being passed to the build.
23:51:42
1 May 2026
@alex:tunstall.xyzAlexWell, cross isn't terribly difficult. I've just gotten it working.00:46:32
@vegowotenks:matrix.orgVegOwOtenks joined the room.14:58:29
@vegowotenks:matrix.orgVegOwOtenks

I'm starting out with nix and having trouble with system library fiddling. GHC cannot load the shared object for z3, though the C headers are found just fine.
This is my flake definition:

{
  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
    flake-utils.url = "github:numtide/flake-utils";
  };

  outputs = { self, nixpkgs, flake-utils }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        pkgs = import nixpkgs { inherit system; };
	in {
		devShells.default = with pkgs; mkShell
		{
			packages =
				[ haskell.compiler.ghc914
				  z3
				  stack
				  libllvm
				  libclang
				];
		};
	}
	);
}
15:02:18
@alexfmpe:matrix.orgalexfmpe I dunno about flakes, but nix-build -A haskellPackages.smtlib-backends-z3 on nixpkgs master works just fine on my macos 15:04:23
@alexfmpe:matrix.orgalexfmpe where hackage-packages.nix shows z3 on librarySystemDepends of smtlib-backends-z3 15:05:11
@alexfmpe:matrix.orgalexfmpe ah, same for haskellPackages.z3 15:06:27
@alexfmpe:matrix.orgalexfmpe huh, isn't packages for executables only? 15:07:47
@alexfmpe:matrix.orgalexfmpehttps://nixos.org/manual/nixpkgs/stable/#sec-pkgs-mkShell15:07:48
@alexfmpe:matrix.orgalexfmpe* https://nixos.org/manual/nixpkgs/stable/#sec-pkgs-mkShell-attributes15:07:56
@alexfmpe:matrix.orgalexfmpe try inputsFrom 15:08:04
@vegowotenks:matrix.orgVegOwOtenksThanks! I will try inputsFrom, I don't have any clue about the differences.15:12:54
@alexfmpe:matrix.orgalexfmpemy link should explain it15:15:50
@alexfmpe:matrix.orgalexfmpe* my link above explains them15:15:59
@alexfmpe:matrix.orgalexfmpeyou probably want the same for libllvm and libclang15:17:55
@alexfmpe:matrix.orgalexfmpe

can we improve the whole security_tool issue for mac builds?

https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/haskell-modules/configuration-darwin.nix is littered with

  • dontCheck that, well, makes us not run tests
  • substituteInPlace System/X509/MacOS.hs --replace-fail security /usr/bin/security that breaks sandbox builds

I also run into it for some packages on darwin pkgsStatic builds somehow due to the iserv-proxy thing

statistics> [33 of 51] Compiling Statistics.Types ( Statistics/Types.hs, dist/build/Statistics/Types.o )
statistics> iserv-proxy: Uncaught exception ghc-internal:GHC.Internal.IO.Exception.IOException:
statistics>
statistics> /homeless-shelter/Library/Frameworks/Security.framework/Security: withBinaryFile: does not exist (No such file or directory)
statistics>
statistics> HasCallStack backtrace:
statistics>   ioError, called at libraries/ghc-internal/src/GHC/Internal/Foreign/C/Error.hs:291:5 in ghc-internal:GHC.Internal.Foreign.C.Error
statistics>
statistics> <no location info>: error: External interpreter terminated (1)
16:45:24
@alexfmpe:matrix.orgalexfmpe *

can we improve the whole security_tool issue for mac builds?

https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/haskell-modules/configuration-darwin.nix is littered with

  • dontCheck that, well, makes us not run tests
  • substituteInPlace System/X509/MacOS.hs --replace-fail security /usr/bin/security that breaks sandbox builds

I also run into it for some packages on darwin pkgsStatic.haskellPackages builds somehow via iserv-proxy

statistics> [33 of 51] Compiling Statistics.Types ( Statistics/Types.hs, dist/build/Statistics/Types.o )
statistics> iserv-proxy: Uncaught exception ghc-internal:GHC.Internal.IO.Exception.IOException:
statistics>
statistics> /homeless-shelter/Library/Frameworks/Security.framework/Security: withBinaryFile: does not exist (No such file or directory)
statistics>
statistics> HasCallStack backtrace:
statistics>   ioError, called at libraries/ghc-internal/src/GHC/Internal/Foreign/C/Error.hs:291:5 in ghc-internal:GHC.Internal.Foreign.C.Error
statistics>
statistics> <no location info>: error: External interpreter terminated (1)
16:45:47
@alexfmpe:matrix.orgalexfmpehuh, wait, maybe that's not the same "security" ? hard to tell with case insensitive system16:47:08
2 May 2026
@sternenseemann:systemli.orgsterni (he/him)
In reply to @alexfmpe:matrix.org

can we improve the whole security_tool issue for mac builds?

https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/haskell-modules/configuration-darwin.nix is littered with

  • dontCheck that, well, makes us not run tests
  • substituteInPlace System/X509/MacOS.hs --replace-fail security /usr/bin/security that breaks sandbox builds

I also run into it for some packages on darwin pkgsStatic builds somehow due to the iserv-proxy thing

statistics> [33 of 51] Compiling Statistics.Types ( Statistics/Types.hs, dist/build/Statistics/Types.o )
statistics> iserv-proxy: Uncaught exception ghc-internal:GHC.Internal.IO.Exception.IOException:
statistics>
statistics> /homeless-shelter/Library/Frameworks/Security.framework/Security: withBinaryFile: does not exist (No such file or directory)
statistics>
statistics> HasCallStack backtrace:
statistics>   ioError, called at libraries/ghc-internal/src/GHC/Internal/Foreign/C/Error.hs:291:5 in ghc-internal:GHC.Internal.Foreign.C.Error
statistics>
statistics> <no location info>: error: External interpreter terminated (1)
that looks like the internal linker trying to load the Security framework, but I don’t think that’s available as a static archive, so won’t work at all in pkgsStatic?!
07:30:00
@tks_123:matrix.orgtks_123Hi all16:39:50
@tks_123:matrix.orgtks_123Redacted or Malformed Event16:40:28
@tks_123:matrix.orgtks_123 I have this flake.nix: https://pastebox.io/api/paste/3WT3DwMK6KZz 16:41:56

Show newer messages


Back to Room ListRoom Version: 6