nix-dotfiles/modules/software/editors/vscode.nix
2025-05-18 23:05:26 -07:00

103 lines
3.1 KiB
Nix

{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.modules.software.editors.vscode;
in {
options.modules.software.editors.vscode = {
enable = mkEnableOption "Enable visual studio code, microsoft's gui code editor + IDE";
};
config = mkIf cfg.enable {
hm.programs.vscode = {
enable = true;
mutableExtensionsDir = false;
profiles.default = {
enableExtensionUpdateCheck = false;
enableUpdateCheck = false;
extensions = with pkgs.vscode-extensions; [
# nix is *the* language here
jnoortheen.nix-ide
# general extensions
oderwat.indent-rainbow
usernamehw.errorlens
editorconfig.editorconfig
ms-vsliveshare.vsliveshare
ms-vscode-remote.remote-ssh
ms-vscode.hexeditor
tamasfe.even-better-toml
github.copilot
# language specific
# js/ts
dbaeumer.vscode-eslint
astro-build.astro-vscode
# rs
rust-lang.rust-analyzer
# lua
sumneko.lua
] ++ pkgs.vscode-utils.extensionsFromVscodeMarketplace [
# general extensions
{
name = "discord-vscode";
publisher = "icrawl";
version = "5.8.0";
sha256 = "sha256-IU/looiu6tluAp8u6MeSNCd7B8SSMZ6CEZ64mMsTNmU=";
}
];
userSettings = with config.modules.desktop.fonts.fonts; {
"editor.fontFamily" = "'${monospace.family}', monospace";
"editor.fontSize" = monospace.size;
"terminal.integrated.fontFamily" = "\"${monospace.family}\"";
"terminal.integrated.fontSize" = monospace.size;
"terminal.integrated.smoothScrolling" = true;
"telemetry.telemetryLevel" = "off";
"editor.tabSize" = 4;
"editor.cursorSmoothCaretAnimation" = "on";
"window.dialogStyle" = "custom";
"window.titleBarStyle" = "custom";
"workbench.tips.enabled" = false;
"workbench.list.smoothScrolling" = true;
"nix.enableLanguageServer" = true;
"nix.serverPath" = "${lib.getExe pkgs.nil}";
"security.workspace.trust.enabled" = "false";
"explorer.compactFolders" = false;
"explorer.confirmDelete" = false;
"explorer.confirmDragAndDrop" = true;
"editor.smoothScrolling" = true;
"editor.wordWrap" = "on";
"editor.wrappingStrategy" = "advanced";
"editor.fontWeight" = "normal";
"editor.semanticHighlighting.enabled" = true;
# prevent vscode from modifying the terminal colors
"terminal.integrated.minimumContrastRatio" = 1;
};
};
};
# gnome-keyring, kwallet, etc. support
# this is the generic libsecret library, should work for every store
hm.home.file.".vscode/argv.json" = {
force = true;
text = builtins.toJSON {
password-store = "gnome-libsecret";
# will complain if this isnt defined...
# but theres a unique id which doesnt really work for us. we are killing it
enable-crash-reporter = false;
};
};
};
}