From 1370e8edf2f5da612c0a5e57b15d57b88f21d41d Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Fri, 19 Mar 2021 21:47:49 +0100 Subject: Move and split javascript module to dev/javascript,web --- user/settings/development/javascript.nix | 119 +++++++++++++++++++++++++++++++ user/settings/development/web.nix | 9 +++ 2 files changed, 128 insertions(+) create mode 100644 user/settings/development/javascript.nix create mode 100644 user/settings/development/web.nix (limited to 'user/settings/development') diff --git a/user/settings/development/javascript.nix b/user/settings/development/javascript.nix new file mode 100644 index 00000000..93e82a4a --- /dev/null +++ b/user/settings/development/javascript.nix @@ -0,0 +1,119 @@ +{ config, pkgs, ... }: + +let + nodejs = pkgs.nodejs-14_x; +in +{ + nixpkgs.overlays = [ + (self: super: { + node2nixPackages = super.callPackage ../packages/node2nix { + inherit nodejs; + }; + }) + ]; + home.packages = (with pkgs; [ + nodejs + ] ++ ( + if stdenv.isDarwin + then + [ + ] + else + [ + # npm install may use any of these + binutils + gcc + python2 + ] + )) ++ (with pkgs.nodePackages; [ + node2nix + nodemon + javascript-typescript-langserver + typescript-language-server + eslint_d + typescript + + node-gyp + node-gyp-build + node-pre-gyp + ]) ++ (with pkgs.node2nixPackages; [ + pkgs.node2nixPackages."pnpm-5.17.3" + + pino-pretty + ]); + + 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"; + 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/ + script-shell=${pkgs.zsh}/bin/zsh + always-auth=true + sign-git-tag=true + rebuild-bundle=false + update-notifier=false + registry=https://registry.npmjs.org/ + ''; +} diff --git a/user/settings/development/web.nix b/user/settings/development/web.nix new file mode 100644 index 00000000..2af4c361 --- /dev/null +++ b/user/settings/development/web.nix @@ -0,0 +1,9 @@ +{ config, pkgs, ... }: +{ + home.packages = with pkgs.nodePackages; [ + vscode-css-languageserver-bin + vscode-html-languageserver-bin + csslint + ] ++ (with pkgs.node2nixPackages; [ + stylelint + ]) ; -- cgit 1.4.1