infrastructure/common/hm-modules/vscode.nix
2025-05-05 15:04:48 +02:00

115 lines
3.8 KiB
Nix

{
config,
pkgs,
lib,
...
}:
with lib;
let
cfg = config.programs.v.vscode;
in
{
options.programs.v.vscode = {
enable = mkEnableOption "vscode";
};
config = mkIf cfg.enable {
programs.vscode = {
enable = true;
package = pkgs.vscode;
profiles.default = {
userSettings = {
"ltex.language" = "en-GB";
"latex-workshop.linting.chktex.enabled" = true;
"latex-workshop.latex.clean.subfolder.enabled" = true;
"latex-workshop.latex.outDir" = "%TMPDIR%/%RELATIVE_DOC%";
"editor.fontFamily" = "'DejaVuSansMono Nerd Font', 'monospace', monospace";
"keyboard.dispatch" = "keyCode";
"rust-analyzer.server.path" = "${pkgs.rust-analyzer}/bin/rust-analyzer";
"rust-analyzer.check.extraArgs" = [
"--profile"
"rust-analyzer"
];
"rust-analyzer.check.command" = "clippy";
"terminal.integrated.defaultProfile.linux" = "zsh";
"nix.enableLanguageServer" = true; # Enable LSP.
"nix.serverPath" = "${pkgs.nil}/bin/nil";
"[nix]" = {
"editor.defaultFormatter" = "brettm12345.nixfmt-vscode";
};
"[python]" = {
"editor.formatOnType" = true;
};
"debug.allowBreakpointsEverywhere" = true;
"C_Cpp.clang_format_fallbackStyle" = "{ BasedOnStyle: Google, IndentWidth: 4, ColumnLimit: 0}";
# "crates.compatibleDecorator" = "✓";
# "crates.errorDecorator" = "✗";
# "crates.incompatibleDecorator" = "🛇";
# Verilog
"verilog.formatting.verilogHDL.formatter" = "verible-verilog-format";
"verilog.languageServer.svls.enabled" = true;
"verilog.languageServer.svls.path" = "${pkgs.svls}/bin/svls";
"verilog.languageServer.veribleVerilogLs.enabled" = true;
"verilog.languageServer.veribleVerilogLs.path" = "${pkgs.verible}/bin/verible-verilog-ls";
"verilog.formatting.veribleVerilogFormatter.path" = "${pkgs.verible}/bin/verible-verilog-format";
"verilog.linting.linter" = "verilator";
"verilog.linting.path" = "${pkgs.verilator}/bin/verilator";
"[verilog]" = {
"editor.defaultFormatter" = "mshr-h.veriloghdl";
};
# Don't index unecessary things
"files.exclude" = {
"**/.vscode" = true;
"**/.git" = true;
"**/.svn" = true;
"**/.hg" = true;
"**/.deps" = true;
"**/CVS" = true;
"**/.DS_Store" = true;
"/bin" = true;
"/boot" = true;
"/cdrom" = true;
"/dev" = true;
"/proc" = true;
"/etc" = true;
"/nix" = true;
};
};
extensions = with pkgs.vscode-extensions; [
brettm12345.nixfmt-vscode
# catppuccin.catppuccin-vsc
codezombiech.gitignore
codezombiech.gitignore
davidlday.languagetool-linter
editorconfig.editorconfig
foxundermoon.shell-format
github.copilot
github.copilot-chat
github.vscode-github-actions
james-yu.latex-workshop
jnoortheen.nix-ide
mkhl.direnv
ms-vscode-remote.remote-ssh
ms-vscode.cpptools
ms-vsliveshare.vsliveshare
mshr-h.veriloghdl
# platformio.platformio-ide
redhat.vscode-xml
redhat.vscode-yaml
rust-lang.rust-analyzer
skellock.just
sumneko.lua
tamasfe.even-better-toml
vadimcn.vscode-lldb
vadimcn.vscode-lldb
valentjn.vscode-ltex
vscodevim.vim
xaver.clang-format
continue.continue
];
};
};
};
}