Skip to content

Instantly share code, notes, and snippets.

@angerman
Created July 29, 2019 14:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angerman/2fa83049359f0079695c69678b20ccd9 to your computer and use it in GitHub Desktop.
Save angerman/2fa83049359f0079695c69678b20ccd9 to your computer and use it in GitHub Desktop.
(self: super: super.lib.recursiveUpdate super {
lib.systems.examples = {
# Ghcjs
ghcjs = {
config = "js-unknown-none-ghcjs";
platform = {};
};
# Asterius
asterius32 = {
config = "wasm32-unknown-none-asterius";
platform = {};
};
asterius64 = {
config = "wasm64-unknown-none-asterius";
platform = {};
};
};
gcc = if self.targetPlatform.isGhcjs then null else super.gcc;
lib.systems.parse = with self.lib.systems.parse; {
cpuTypes.js = cpuTypes.wasm32 // { name = "js"; family = "js"; };
kernels.ghcjs = kernels.none // { name = "ghcjs"; };
kernels.asterius = kernels.none // { name = "asterius"; };
};
lib.systems.inspect.patterns = with self.lib.systems.parse; {
isJavaScript = { cpu = cpuTypes.js; };
isWasm32 = { cpu = cpuTypes.wasm32; };
isWasm64 = { cpu = cpuTypes.wasm64; };
isGhcjs = { kernel = kernels.ghcjs; };
isAsterius = { kernel = kernels.asterius; };
};
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment