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/mba.nix | 3 +- user/prefect.nix | 3 +- user/satoshipad.nix | 3 +- user/settings/development/javascript.nix | 119 +++++++++++++++++++++++++++++ user/settings/development/web.nix | 9 +++ user/settings/javascript.nix | 124 ------------------------------- user/settings/satoshipay.nix | 3 +- 7 files changed, 136 insertions(+), 128 deletions(-) create mode 100644 user/settings/development/javascript.nix create mode 100644 user/settings/development/web.nix delete mode 100644 user/settings/javascript.nix diff --git a/user/mba.nix b/user/mba.nix index 370ec38f..290f9968 100644 --- a/user/mba.nix +++ b/user/mba.nix @@ -6,13 +6,14 @@ ./settings/base.nix ./settings/development/base.nix + ./settings/development/javascript.nix + ./settings/development/web.nix ./settings/accounting.nix ./settings/darwin.nix ./settings/emacs.nix ./settings/git.nix ./settings/gnupg.nix ./settings/golang.nix - ./settings/javascript.nix ./settings/ledger.nix ./settings/nixpkgs.nix ./settings/satoshipay.nix diff --git a/user/prefect.nix b/user/prefect.nix index 2831c5e1..358327d3 100644 --- a/user/prefect.nix +++ b/user/prefect.nix @@ -8,11 +8,12 @@ ./settings/emacs.nix ./settings/development/base.nix ./settings/development/lisp.nix + ./settings/development/javascript.nix + ./settings/development/web.nix ./settings/gaming.nix ./settings/git.nix ./settings/gnupg.nix ./settings/i3.nix - ./settings/javascript.nix ./settings/music.nix ./settings/nixos.nix ./settings/rofi.nix diff --git a/user/satoshipad.nix b/user/satoshipad.nix index e1326b8e..14dc9eb8 100644 --- a/user/satoshipad.nix +++ b/user/satoshipad.nix @@ -7,12 +7,13 @@ ./settings/base.nix ./settings/chat.nix ./settings/development/base.nix + ./settings/development/javascript.nix + ./settings/development/web.nix ./settings/dunst.nix ./settings/emacs.nix ./settings/git.nix ./settings/gnupg.nix ./settings/i3.nix - ./settings/javascript.nix ./settings/mail.nix ./settings/music.nix ./settings/nixos.nix 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 + ]) ; diff --git a/user/settings/javascript.nix b/user/settings/javascript.nix deleted file mode 100644 index 1ca1a1ba..00000000 --- a/user/settings/javascript.nix +++ /dev/null @@ -1,124 +0,0 @@ -{ 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 - vscode-css-languageserver-bin - vscode-html-languageserver-bin - csslint - eslint_d - typescript - - node-gyp - node-gyp-build - node-pre-gyp - ]) ++ (with pkgs.node2nixPackages; [ - pkgs.node2nixPackages."pnpm-5.17.3" - - stylelint - - 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/satoshipay.nix b/user/settings/satoshipay.nix index c1b0f0ec..56fa1041 100644 --- a/user/settings/satoshipay.nix +++ b/user/settings/satoshipay.nix @@ -8,7 +8,8 @@ let in { imports = [ - ./javascript.nix + ./development/javascript.nix + ./development/web.nix ]; home.sessionVariables = { -- cgit 1.4.1