{ config, lib, pkgs, ... }: { home.packages = with pkgs; [ typescript-language-server vtsls biome ]; home.sessionVariables = { NO_UPDATE_NOTIFIER = "1"; # stop npm update-notifier }; programs.bun = { enable = true; settings = { run = { bun = true; silent = true; }; env = false; # don't load .envrc; handled by direnv install = { prefer = "offline"; globalDir = "${config.xdg.stateHome}/bun/install/global"; globalBinDir = "${config.xdg.stateHome}/bun/bin"; cache = { dir = "${config.xdg.cacheHome}/bun/"; }; }; }; }; home.sessionPath = lib.mkAfter [ config.programs.bun.settings.install.globalBinDir ]; programs.emacs.extraPackages = epkgs: (with epkgs; [ (treesit-grammars.with-grammars ( grammars: with grammars; [ tree-sitter-jsdoc tree-sitter-tsx tree-sitter-typescript tree-sitter-javascript ] )) ]); programs.zed-editor = { extensions = [ "biome" ]; userSettings = { lsp.biome.settings.require_config_file = true; languages = let justFormatWithBiome = { formatter.language_server.name = "biome"; }; biomeFormattedLanguages = lib.genAttrs [ "CSS" "HTML" "JSON" "JSONC" ] (lib.const justFormatWithBiome); in biomeFormattedLanguages // rec { TypeScript = { formatter.language_server.name = "biome"; code_actions_on_format = { "source.fixAll.biome" = true; "source.organizeImports.biome" = true; }; }; TSX = TypeScript; JavaScript = TypeScript; }; }; }; home.shellAliases = { bn = "bun"; bni = "bun install"; bna = "bun add"; bnad = "bun add --dev"; bnr = "bun run"; bnu = "bun update"; bnrm = "bun remove"; bnd = "bun dev"; bnp = "bun pm"; bnl = "bun pm ls"; bnt = "bun test"; bntw = "bun test --watch"; bnx = "bunx"; 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"; }; programs.git.attributes = [ "*.lockb diff=lockb" ]; programs.git.settings."diff.lockb" = { textconv = "bun"; binary = true; }; xdg.configFile."npm/config".text = '' prefix=''${HOME}/.local cache=${config.xdg.cacheHome}/npm/ sign-git-tag=true rebuild-bundle=false update-notifier=false registry=https://registry.npmjs.org/ @jsr:registry=https://npm.jsr.io ''; }