nixos-config/modules/dev/javascript.nix
Gabriel Arazas 49592d7f01 Use the unstable version for the nth time
I also fixed the long-time occuring error when using the newest version
of the channel (or the unstable one). It turns out to be a simple type
error with the `my.user' attribute. (To be honest the error messages are
quite horrible.)

On another note, I also accidentally bricked my NixOS setup after a
garbage collection and a horrible update. The breakage includes not
being able to use any of the builtin tools of Nix (e.g., nix, nix-env,
nixos-rebuild) due to a shared library error that has been garbage
collected. Which means I have to reinstall it.
(I seem to have a talent for breaking things, if only I'm paid for it.)
2020-10-05 09:38:58 +08:00

32 lines
911 B
Nix
Executable File

# 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 = {
my.packages = with pkgs;
(if cfg.deno.enable then [
deno # The Deltarune of Node.
] else []) ++
(if cfg.node.enable then [
nodejs # The JavaScript framework/runtime where you don't have to kill someone for bad code. :)
] else []);
};
}