23 lines
480 B
Nix
23 lines
480 B
Nix
# JavaScript/TypeScript runtime — Node.js and Bun.
|
|
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
with lib; let
|
|
cfg = config.coding.languages.javascript;
|
|
npmGlobalPrefix = "${config.home.homeDirectory}/.npm-global";
|
|
in {
|
|
options.coding.languages.javascript.enable = mkEnableOption "JavaScript runtime (Node.js + Bun)";
|
|
|
|
config = mkIf cfg.enable {
|
|
home.packages = with pkgs; [
|
|
nodejs
|
|
bun
|
|
];
|
|
|
|
home.sessionVariables.NPM_CONFIG_PREFIX = npmGlobalPrefix;
|
|
};
|
|
}
|