Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion dynamic.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# define a development shell for dynamically linked applications (default)
{ self, pkgs, compiler, compiler-nix-name, toolsModule, withHLS ? true, withHlint ? true, withIOG ? true, withIOGFull ? false, withGHCTooling ? false }:
{ self, pkgs, compiler, compiler-nix-name, toolsModule, withHLS ? true, withHlint ? true, withIOG ? true, withIOGFull ? false, withGHCTooling ? false, withWebTooling ? false }:
let iog = import ./iog-libs.nix { inherit pkgs; };
tool-version-map = (import ./tool-map.nix) self;
tool = tool-name: pkgs.pkgsBuildBuild.haskell-nix.tool compiler-nix-name tool-name [(tool-version-map compiler-nix-name tool-name) toolsModule];
Expand Down Expand Up @@ -78,6 +78,7 @@ pkgs.mkShell {
+ lib.optionalString withIOG "-iog"
+ lib.optionalString withIOGFull "-full"
+ lib.optionalString withGHCTooling "-ghc"
+ lib.optionalString withWebTooling "-web"
;
in ''
export PS1="\[\033[01;33m\][\w]$\[\033[00m\] "
Expand Down Expand Up @@ -154,6 +155,27 @@ pkgs.mkShell {
libffi.dev
]
)
++ optionals withWebTooling (
# Tooling for the wasm and JavaScript backends. wasi-sdk itself is
# deliberately not bundled — its version needs to match the
# wasm32-wasi-ghc cross-compiler bundle, which ghc-wasm-meta owns
# (https://gitlab.haskell.org/ghc/ghc-wasm-meta). Users still bootstrap
# wasi-sdk via ghc-wasm-meta's installer for wasm32-wasi cross-builds.
# What we DO bundle here:
# * nodejs_22 — required for post-link.mjs (uses import.meta.filename
# added in Node 20.11; Ubuntu's apt nodejs is 18.x)
# and for JSFFI host execution
# * wabt — wasm-objdump for inspecting wasm modules
# * wasmtime — pure-WASI runtime (when no JSFFI imports)
# * emscripten — the JavaScript backend's C toolchain (emcc / em++
# / emar / emnm / emranlib / emstrip)
with pkgs; [
nodejs_22
wabt
wasmtime
emscripten
]
)
;

passthru = {
Expand Down
4 changes: 4 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,10 @@
pkgs.lib.nameValuePair "${short-name}-minimal-ghc" (
import ./dynamic.nix (args // { withHLS = false; withHlint = false; withIOG = false; withGHCTooling = true; })
)) (compilers pkgs)
// pkgs.lib.mapAttrs' (short-name: args:
pkgs.lib.nameValuePair "${short-name}-minimal-ghc-web" (
import ./dynamic.nix (args // { withHLS = false; withHlint = false; withIOG = false; withGHCTooling = true; withWebTooling = true; })
)) (compilers pkgs)
// pkgs.lib.mapAttrs' (short-name: args:
pkgs.lib.nameValuePair "${short-name}-static" (
import ./static.nix (args // { withIOG = false; })
Expand Down
Loading