2020-08-06 15:35:49 +00:00
|
|
|
# JavaScript, the poster boy of hated languages...
|
|
|
|
# I think it's pretty great, when it works.
|
|
|
|
# Otherwise, it is a disaster from its syntax and the massive ecosystem among others.
|
|
|
|
# Since I use/experiment with the ecosystem so stuff like Node and Deno are combined into one module file.
|
|
|
|
{ config, options, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.modules.dev.javascript;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
options.modules.dev.javascript =
|
|
|
|
let mkBoolOption = bool: mkOption {
|
|
|
|
type = types.bool;
|
|
|
|
default = bool;
|
|
|
|
}; in {
|
|
|
|
deno.enable = mkBoolOption false;
|
|
|
|
node.enable = mkBoolOption false;
|
|
|
|
};
|
|
|
|
|
|
|
|
config = {
|
2020-08-16 08:33:44 +00:00
|
|
|
my.packages = with pkgs;
|
2020-08-06 15:35:49 +00:00
|
|
|
(if cfg.deno.enable then [
|
2020-10-05 01:38:58 +00:00
|
|
|
deno # The Deltarune of Node.
|
2020-08-06 15:35:49 +00:00
|
|
|
] else []) ++
|
|
|
|
|
|
|
|
(if cfg.node.enable then [
|
2020-08-16 08:33:44 +00:00
|
|
|
nodejs # The JavaScript framework/runtime where you don't have to kill someone for bad code. :)
|
2020-08-06 15:35:49 +00:00
|
|
|
] else []);
|
|
|
|
};
|
|
|
|
}
|