File tree Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Expand file tree Collapse file tree 3 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ with lib.types;
21
21
shell = mkOption {
22
22
type = submodule [
23
23
( import ./shell.nix { projectConfig = config ; } )
24
- { _module . args = { inherit ( pkgs . haskell-nix ) haskellLib ; } ; }
24
+ { _module . args = { inherit pkgs ; inherit ( pkgs . haskell-nix ) haskellLib ; } ; }
25
25
] ;
26
26
default = { } ;
27
27
description = ''
Original file line number Diff line number Diff line change 63
63
} ;
64
64
shellHook = lib . mkOption {
65
65
type = lib . types . str ;
66
- default = "" ;
66
+ # Shell hook to set EM_CACHE to a writable temporary directory if not already set
67
+ default = lib . optionalString pkgs . stdenv . hostPlatform . isGhcjs ''
68
+ if [ -z "$EM_CACHE" ]; then
69
+ # Create a unique temporary directory using mktemp
70
+ EM_CACHE_DIR=$(mktemp -d -t emcache-ghcjs-XXXXXX)
71
+
72
+ # Copy the default Emscripten cache contents to the temporary directory
73
+ DEFAULT_EM_CACHE="${ pkgs . pkgsBuildBuild . emscripten } /share/emscripten/cache"
74
+ if [ -d "$DEFAULT_EM_CACHE" ]; then
75
+ cp -r "$DEFAULT_EM_CACHE"/* "$EM_CACHE_DIR" 2>/dev/null || true
76
+ chmod -R u+w "$EM_CACHE_DIR"
77
+ fi
78
+
79
+ export EM_CACHE="$EM_CACHE_DIR"
80
+ echo "Set EM_CACHE to $EM_CACHE"
81
+ else
82
+ echo "EM_CACHE already set to $EM_CACHE"
83
+ fi
84
+ '' ;
67
85
} ;
68
86
69
87
# mkDerivation args
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ repository head.hackage.ghc.haskell.org
29
29
f76d08be13e9a61a377a85e2fb63f4c5435d40f8feb3e12eb05905edb8cdea89
30
30
26021a13b401500c8eb2761ca95c61f2d625bfef951b939a8124ed12ecf07329
31
31
7541f32a4ccca4f97aea3b22f5e593ba2c0267546016b992dfadcd2fe944e55d
32
- --sha256: sha256-T8qW/tiaMGcxxxA4OXBQc07EYXjhYMXSXSgW0Zg3aRo =
32
+ --sha256: sha256-GDbFKWPkG3IXjgL3DEywVgnMvEMciBfMHdMjhIRFJK4 =
33
33
34
34
repository ghcjs-overlay
35
35
url: https://raw.githubusercontent.com/input-output-hk/hackage-overlay-ghcjs/ffb32dce467b9a4d27be759fdd2740a6edd09d0b
You can’t perform that action at this time.
0 commit comments