vscode: refactor with new profile support
All checks were successful
check / check (push) Successful in 30s
All checks were successful
check / check (push) Successful in 30s
Inspired by 1cc1ff0435/modules/home/programs/graphical/editors/vscode/default.nix
This commit is contained in:
parent
863fc04e17
commit
fff5b682ba
1 changed files with 67 additions and 39 deletions
|
@ -11,49 +11,77 @@ in
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
config = mkIf cfg.enable {
|
config = mkIf cfg.enable {
|
||||||
|
# Inspired by https://github.com/khaneliman/khanelinix/blob/1cc1ff0435671804666cdc732a0b792178441e2f/modules/home/programs/graphical/editors/vscode/default.nix
|
||||||
programs.vscode = {
|
programs.vscode = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableUpdateCheck = false;
|
|
||||||
enableExtensionUpdateCheck = false;
|
|
||||||
|
|
||||||
userSettings = {
|
profiles =
|
||||||
"files.autoSave" = "onFocusChange";
|
let
|
||||||
"emmet.includeLanguages" = {
|
commonExtensions = with pkgs.vscode-extensions; [
|
||||||
"phoenix-heex" = "html";
|
# Direnv to automatically Load Dev Env
|
||||||
|
mkhl.direnv
|
||||||
|
|
||||||
|
# Nix
|
||||||
|
bbenoist.nix
|
||||||
|
|
||||||
|
# Improve error display
|
||||||
|
usernamehw.errorlens
|
||||||
|
];
|
||||||
|
|
||||||
|
commonSettings = {
|
||||||
|
"files.autoSave" = "onFocusChange";
|
||||||
|
"git.autofetch" = true;
|
||||||
|
};
|
||||||
|
in
|
||||||
|
{
|
||||||
|
default = {
|
||||||
|
extensions = commonExtensions;
|
||||||
|
enableUpdateCheck = false;
|
||||||
|
enableExtensionUpdateCheck = false;
|
||||||
|
userSettings = commonSettings;
|
||||||
|
};
|
||||||
|
|
||||||
|
C_CPP = {
|
||||||
|
extensions =
|
||||||
|
with pkgs.vscode-extensions;
|
||||||
|
commonExtensions
|
||||||
|
++ [ ms-vscode.cpptools ];
|
||||||
|
};
|
||||||
|
|
||||||
|
Phoenix = {
|
||||||
|
extensions =
|
||||||
|
with pkgs.vscode-extensions;
|
||||||
|
commonExtensions
|
||||||
|
++ [ phoenixframework.phoenix elixir-lsp.vscode-elixir-ls ];
|
||||||
|
|
||||||
|
userSettings = commonSettings // {
|
||||||
|
"emmet.includeLanguages" = {
|
||||||
|
"phoenix-heex" = "html";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
Ruby = {
|
||||||
|
extensions =
|
||||||
|
with pkgs.vscode-extensions;
|
||||||
|
commonExtensions
|
||||||
|
++ [ shopify.ruby-lsp ];
|
||||||
|
};
|
||||||
|
|
||||||
|
Rust = {
|
||||||
|
extensions =
|
||||||
|
with pkgs.vscode-extensions;
|
||||||
|
commonExtensions
|
||||||
|
++ [ tamasfe.even-better-toml ]; # rust-lang.rust-analyzer not compile for now
|
||||||
|
};
|
||||||
|
|
||||||
|
Typescript = {
|
||||||
|
extensions =
|
||||||
|
with pkgs.vscode-extensions;
|
||||||
|
commonExtensions
|
||||||
|
++ [ yoavbls.pretty-ts-errors ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
"git.autofetch" = true;
|
|
||||||
};
|
|
||||||
|
|
||||||
userTasks = {};
|
|
||||||
|
|
||||||
# Waiting https://github.com/nix-community/home-manager/pull/5640 to support multi-profiles support
|
|
||||||
extensions = with pkgs; with vscode-extensions; [
|
|
||||||
# Direnv to automatically Load Dev Env
|
|
||||||
mkhl.direnv
|
|
||||||
|
|
||||||
# Nix
|
|
||||||
bbenoist.nix
|
|
||||||
|
|
||||||
# Rust
|
|
||||||
rust-lang.rust-analyzer
|
|
||||||
tamasfe.even-better-toml
|
|
||||||
|
|
||||||
# Phoenix
|
|
||||||
phoenixframework.phoenix
|
|
||||||
elixir-lsp.vscode-elixir-ls
|
|
||||||
|
|
||||||
# Ruby
|
|
||||||
shopify.ruby-lsp
|
|
||||||
|
|
||||||
# C/C++ Support
|
|
||||||
ms-vscode.cpptools
|
|
||||||
|
|
||||||
# Improve error display
|
|
||||||
usernamehw.errorlens
|
|
||||||
|
|
||||||
# TS Error
|
|
||||||
yoavbls.pretty-ts-errors
|
|
||||||
];
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue