user/settings/development/javascript.nix (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | { config
, pkgs
, ...
}:
{
home.packages = with pkgs.nodePackages; [
node2nix
typescript-language-server
] ++ (with pkgs; [
vtsls
]);
home.sessionVariables = {
NO_UPDATE_NOTIFIER = "1"; # stop npm update-notifier
};
programs.bun = {
enable = true;
settings = {
run = {
bun = true;
silent = true;
};
};
};
programs.emacs.extraPackages = epkgs: (with epkgs; [
astro-ts-mode
svelte-mode
(treesit-grammars.with-grammars (grammars: with grammars; [
tree-sitter-jsdoc
tree-sitter-svelte
tree-sitter-tsx
tree-sitter-typescript
tree-sitter-javascript
]))
]);
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.extraConfig."diff.lockb" = {
textconv = "bun";
binary = true;
};
xdg.configFile.".bunfig.toml".text = ''
[install.cache]
dir = "${config.xdg.cacheHome}/bun/"
'';
xdg.configFile."npm/config".text = ''
prefix=''${HOME}/.local
cache=${config.xdg.cacheHome}/npm/
always-auth=true
sign-git-tag=true
rebuild-bundle=false
update-notifier=false
registry=https://registry.npmjs.org/
@jsr:registry=https://npm.jsr.io
'';
}
|