{ config, pkgs, ... }: let node = pkgs.nodejs-12_x; node10Packages = pkgs.nodePackages_10_x; in { home.packages = (with pkgs; [ node ] ++ ( if stdenv.isDarwin then [ ] else [ # npm install may use any of these binutils gcc gnumake python2 ] )) ++ (with node10Packages; [ node2nix nodemon javascript-typescript-langserver typescript-language-server vscode-css-languageserver-bin vscode-html-languageserver-bin csslint eslint_d typescript yaml-language-server ]) ++ (with pkgs.node2nixPackages; [ pkgs.node2nixPackages."pnpm-4.11.6" pkgs.node2nixPackages."prettier_d-git://github.com/josephfrazier/prettier_d#b53378114f1ac8331de8d5e49be2190385abbf79" node-gyp node-gyp-build node-pre-gyp stylelint pino-pretty dockerfile-language-server-nodejs ]); home.sessionVariables = { NO_UPDATE_NOTIFIER = "1"; # stop npm update-notifier }; programs.zsh.shellAliases = { ava = "pnpx ava"; avt = "pnpx ava --tap"; avat = "pnpx ava --tap"; avaw = "pnpx ava --watch"; avaf = "pnpx ava --fail-fast"; avafw = "pnpx ava --fail-fast --watch"; avawf = "pnpx ava --fail-fast --watch"; pino = "pino-pretty"; mocha = "pnpx mocha"; prettier = "prettier_d"; standard = "pnpx standard"; tsc = "pnpx tsc"; tslint = "pnpx tslint"; tsnode = "pnpx ts-node"; p = "pnpm"; pi = "pnpm install --filter=."; pit = "pnpm install-test --filter=."; pl = "pnpm ls"; pr = "pnpm run"; pb = "pnpm run build"; prb = "pnpm run build"; pbd = "pnpm multi run build --filter={.}..."; pmi = "pnpm multi install"; pmx = "pnpm multi exec "; # expand command aliases pmr = "pnpm multi run"; pa = "pnpm add"; pad = "pnpm add --save-dev"; pd = "pnpm uninstall"; pou = "pnpm outdated"; pt = "pnpm test"; pmt = "pnpm multi test"; pmd = "pnpm multi uninstall"; pmit = "pnpm multi install-test"; pup = "pnpm update"; pupl = "pnpm update --latest"; ppr = "pnpm prune"; pprp = "pnpm prune --production"; pli = "pnpm link"; pdi = "pnpm dislink"; pul = "pnpm unlink"; np = "npm"; npi = "npm install"; npl = "npm ls"; npr = "npm run"; npb = "npm run build"; nprb = "npm run build"; npa = "npm install --save"; npad = "npm install --save-dev"; npd = "npm uninstall"; npt = "npm test"; npup = "npm update"; nppr = "npm prune"; npprp = "npm prune --production"; npli = "npm link"; npul = "npm unlink"; }; home.file.".npmrc".text = '' prefix=''${HOME}/.local cache=${config.xdg.cacheHome}/npm/ store-dir=${config.xdg.cacheHome}/pnpm/ //registry.npmjs.org/:_authToken=${config.home.sessionVariables.NPM_AUTH_TOKEN} always-auth=true sign-git-tag=true rebuild-bundle=false update-notifier=false registry=https://registry.npmjs.org/ ''; }