home-manager/systems/common/vscode.nix

116 lines
3.0 KiB
Nix

{
pkgs,
vscode-extensions,
...
}: {
programs.vscode = rec {
enable = true;
package = pkgs.unstable.vscode; # To use the latest unstable vscode
enableUpdateCheck = false;
enableExtensionUpdateCheck = false;
keybindings = [
{
key = "alt+a";
command = "editor.action.commentLine";
when = "editorTextFocus && !editorReadonly";
}
];
# This will only yield extensions that are compatible with the installed version of vscode
extensions = with (vscode-extensions.forVSCodeVersion package.version).vscode-marketplace; [
jnoortheen.nix-ide
mkhl.direnv
ms-python.python
ms-python.vscode-pylance
ms-python.autopep8
james-yu.latex-workshop
github.copilot
davidanson.vscode-markdownlint
tamasfe.even-better-toml
asciidoctor.asciidoctor-vscode
ziglang.vscode-zig
slevesque.shader
ms-vscode.cpptools
streetsidesoftware.code-spell-checker
streetsidesoftware.code-spell-checker-german
];
userSettings = {
"git.enableCommitSigning" = true;
"window.menuBarVisibility" = "hidden";
"editor.fontFamily" = "'FiraCode Nerd Font'";
"editor.fontLigatures" = true;
"editor.minimap.enabled" = false;
"extensions.ignoreRecommendations" = true;
"[nix]" = {
"editor.formatOnSave" = true;
"editor.formatOnSaveMode" = "file"; # modificationsIfAvailable does not work
};
"[python]" = {
"editor.formatOnSave" = true;
"editor.formatOnSaveMode" = "modificationsIfAvailable";
"editor.defaultFormatter" = "ms-python.autopep8";
};
"[latex]" = {
"editor.formatOnSave" = true;
"editor.formatOnSaveMode" = "file"; # modificationsIfAvailable does not work
};
"[toml]" = {
"editor.formatOnSave" = true;
"editor.formatOnSaveMode" = "modificationsIfAvailable";
};
"[c]" = {
"editor.formatOnSave" = true;
"editor.formatOnSaveMode" = "modificationsIfAvailable";
};
"[cpp]" = {
"editor.formatOnSave" = true;
"editor.formatOnSaveMode" = "modificationsIfAvailable";
};
"nix.enableLanguageServer" = true;
"nix.serverPath" = "${pkgs.nil}/bin/nil";
"nix.serverSettings" = {
nil = {
formatting = {command = ["${pkgs.alejandra}/bin/alejandra"];};
};
};
"direnv.path.executable" = "${pkgs.direnv}/bin/direnv";
"latex-workshop.latex.outDir" = "%DIR%/out";
"terminal.integrated.profiles.linux" = {
"bash" = {
"path" = "${pkgs.bashInteractive}/bin/bash";
"args" = [];
};
};
"terminal.integrated.defaultProfile.linux" = "bash";
"cSpell.language" = "en,de-de";
"zig.zigPath" = ""; # Use the zig from the PATH
"zig.zls.path" = "${pkgs.unstable.zls}/bin/zls";
"C_Cpp.default.compilerPath" = "${pkgs.gnat11}/bin/g++";
"C_Cpp.default.includePath" = [
"\${workspaceFolder}/**"
];
};
};
}