nix-dotfiles/modules/software/editors/vscode.nix

98 lines
3 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; [
# general extensions
oderwat.indent-rainbow
usernamehw.errorlens
editorconfig.editorconfig
ms-vsliveshare.vsliveshare
ms-vscode-remote.remote-ssh
ms-vscode.hexeditor
tamasfe.even-better-toml
leonardssh.vscord
# language specific
# nix
jnoortheen.nix-ide
# javascript/typescript
dbaeumer.vscode-eslint
astro-build.astro-vscode
# rust
rust-lang.rust-analyzer
# lua
sumneko.lua
# wgsl
wgsl-analyzer.wgsl-analyzer
];
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;
# prevent vscode from messing up font spacing
"terminal.integrated.letterSpacing" = 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;
};
};
};
}