Set up typescript language server and add meld to git.
This commit is contained in:
parent
8847063948
commit
03f0721e1f
@ -131,8 +131,9 @@ in
|
||||
final.cmake-language-server
|
||||
final.cmake # Used by cmake-language-server
|
||||
final.rust-analyzer
|
||||
final.nodePackages_latest.prettier # Format yaml, json, and JS
|
||||
final.prettier # Format yaml, json, and JS
|
||||
final.terraform-ls
|
||||
final.typescript-language-server
|
||||
]
|
||||
}
|
||||
'';
|
||||
|
@ -1,6 +1,12 @@
|
||||
(require 'common-lsp)
|
||||
(require 'util-tree-sitter)
|
||||
|
||||
(defun js-format-buffer ()
|
||||
"Run prettier."
|
||||
(interactive)
|
||||
(run-command-on-buffer "prettier" "--stdin-filepath" buffer-file-name)
|
||||
)
|
||||
|
||||
(use-package json-ts-mode
|
||||
:ensure nil
|
||||
:pin manual
|
||||
@ -113,10 +119,14 @@
|
||||
("\\.js\\'" . js-ts-mode)
|
||||
)
|
||||
:commands (js-ts-mode)
|
||||
:custom (
|
||||
(js-indent-level 2)
|
||||
)
|
||||
:hook (
|
||||
(js-ts-mode . (lambda ()
|
||||
(when-linux
|
||||
(eglot-ensure)
|
||||
(add-hook 'before-save-hook 'js-format-buffer nil 'local)
|
||||
)
|
||||
))
|
||||
)
|
||||
|
@ -20,7 +20,7 @@
|
||||
config = lib.mkMerge [
|
||||
{
|
||||
environment.systemPackages = with pkgs; [
|
||||
git
|
||||
my_git
|
||||
];
|
||||
}
|
||||
(lib.mkIf (config.me.git.config != null) {
|
||||
@ -32,54 +32,32 @@
|
||||
};
|
||||
};
|
||||
})
|
||||
# (lib.mkIf (config.me.graphical) {
|
||||
# nixpkgs.overlays = [
|
||||
# (final: prev: {
|
||||
# git = pkgs.buildEnv {
|
||||
# name = prev.git.name;
|
||||
# paths = [
|
||||
# prev.git
|
||||
# ];
|
||||
# extraOutputsToInstall = [
|
||||
# "man"
|
||||
# "doc"
|
||||
# "info"
|
||||
# ];
|
||||
# buildInputs = [ final.makeWrapper ];
|
||||
# postBuild = ''
|
||||
# wrapProgram $out/bin/git --prefix PATH : ${
|
||||
# lib.makeBinPath [
|
||||
# final.meld
|
||||
# ]
|
||||
# }
|
||||
# '';
|
||||
# };
|
||||
# })
|
||||
# ];
|
||||
# })
|
||||
# (lib.mkIf (!config.me.graphical) {
|
||||
# nixpkgs.overlays = [
|
||||
# (final: prev: {
|
||||
# git = pkgs.buildEnv {
|
||||
# name = prev.git.name;
|
||||
# paths = [
|
||||
# prev.git
|
||||
# ];
|
||||
# extraOutputsToInstall = [
|
||||
# "man"
|
||||
# "doc"
|
||||
# "info"
|
||||
# ];
|
||||
# buildInputs = [ final.makeWrapper ];
|
||||
# postBuild = ''
|
||||
# wrapProgram $out/bin/git --prefix PATH : ${
|
||||
# lib.makeBinPath [
|
||||
# ]
|
||||
# }
|
||||
# '';
|
||||
# };
|
||||
# })
|
||||
# ];
|
||||
# })
|
||||
(lib.mkIf (config.me.graphical) {
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
my_git = pkgs.symlinkJoin {
|
||||
name = final.git.name;
|
||||
paths = [
|
||||
final.git
|
||||
];
|
||||
nativeBuildInputs = [ final.makeWrapper ];
|
||||
postBuild = ''
|
||||
wrapProgram $out/bin/git --prefix PATH : ${
|
||||
lib.makeBinPath [
|
||||
final.meld
|
||||
]
|
||||
}
|
||||
'';
|
||||
};
|
||||
})
|
||||
];
|
||||
})
|
||||
(lib.mkIf (!config.me.graphical) {
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
my_git = final.git;
|
||||
})
|
||||
];
|
||||
})
|
||||
];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user