nixos/modules/home/editors/vscode.nix
Florian RICHER e9129037ef
All checks were successful
check / check (push) Successful in 40s
vscode: rust-analyzer seem to be fixed in last OS version
2025-02-26 18:36:27 +01:00

87 lines
No EOL
2.2 KiB
Nix

{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.modules.home.editors.vscode;
in
{
options.modules.home.editors.vscode = {
enable = mkEnableOption ''
Enable vscode with my custom configurations
'';
};
config = mkIf cfg.enable {
# Inspired by https://github.com/khaneliman/khanelinix/blob/1cc1ff0435671804666cdc732a0b792178441e2f/modules/home/programs/graphical/editors/vscode/default.nix
programs.vscode = {
enable = true;
profiles =
let
commonExtensions = with pkgs.vscode-extensions; [
# 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 ];
};
Typescript = {
extensions =
with pkgs.vscode-extensions;
commonExtensions
++ [ yoavbls.pretty-ts-errors ];
};
};
};
};
}