<commit_before># modules/dev/node.nix --- https://nodejs.org/en/
#
# JS is one of those "when it's good, it's alright, when it's bad, it's a
# disaster" languages.

{ config, options, lib, pkgs, ... }:

with lib;
with lib.my;
let cfg = config.modules.dev.node;
in {
  options.modules.dev.node = {
    enable = mkBoolOpt false;
  };

  config = mkIf cfg.enable {
    user.packages = with pkgs; [
      nodejs
      yarn
    ];

    env.NPM_CONFIG_USERCONFIG = "$XDG_CONFIG_HOME/npm/config";
    env.NPM_CONFIG_CACHE      = "$XDG_CACHE_HOME/npm";
    env.NPM_CONFIG_TMP        = "$XDG_RUNTIME_DIR/npm";
    env.NPM_CONFIG_PREFIX     = "$XDG_CACHE_HOME/npm";
    env.NODE_REPL_HISTORY     = "$XDG_CACHE_HOME/node/repl_history";
    env.PATH = [ "$(yarn global bin)" ];

    # Run locally installed bin-script, e.g. n coffee file.coffee
    environment.shellAliases = {
      n  = "PATH=\"$(npm bin):$PATH\"";
      ya = "yarn";
    };

    home.configFile."npm/config".text = ''
      cache=$XDG_CACHE_HOME/npm
      prefix=$XDG_DATA_HOME/npm
    '';
  };<commit_msg>Resolve paths to yarn/npm<commit_after># modules/dev/node.nix --- https://nodejs.org/en/
#
# JS is one of those "when it's good, it's alright, when it's bad, it's a
# disaster" languages.

{ config, options, lib, pkgs, ... }:

with lib;
with lib.my;
let cfg = config.modules.dev.node;
in {
  options.modules.dev.node = {
    enable = mkBoolOpt false;
  };

  config = mkIf cfg.enable {
    user.packages = with pkgs; [
      nodejs
      yarn
    ];

    env.NPM_CONFIG_USERCONFIG = "$XDG_CONFIG_HOME/npm/config";
    env.NPM_CONFIG_CACHE      = "$XDG_CACHE_HOME/npm";
    env.NPM_CONFIG_TMP        = "$XDG_RUNTIME_DIR/npm";
    env.NPM_CONFIG_PREFIX     = "$XDG_CACHE_HOME/npm";
    env.NODE_REPL_HISTORY     = "$XDG_CACHE_HOME/node/repl_history";
    env.PATH = [ "$(${pkgs.yarn}/bin/yarn global bin)" ];

    # Run locally installed bin-script, e.g. n coffee file.coffee
    environment.shellAliases = {
      n  = "PATH=\"$(${pkgs.nodejs}/bin/npm bin):$PATH\"";
      ya = "yarn";
    };

    home.configFile."npm/config".text = ''
      cache=$XDG_CACHE_HOME/npm
      prefix=$XDG_DATA_HOME/npm
    '';
  };
{'fraction_non_alphanumeric': 0.15487132352941177, 'fraction_numerical': 0.0, 'mean_word_length': 2.7213675213675215, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4079074', 'n_tokens_mistral': 863, 'n_tokens_neox': 808, 'n_words': 153}