configure vscode nix formatting

This commit is contained in:
Vinzenz Schroeter 2025-05-18 11:03:25 +02:00
parent 889bff482c
commit b6ad841847
2 changed files with 113 additions and 96 deletions

View file

@ -1,57 +1,65 @@
{ pkgs, ... }: { pkgs, lib, ... }:
{ {
config.programs.vscode = { config = {
enable = true; home.sessionVariables.NIXOS_OZONE_WL = "1";
package = pkgs.vscodium; programs.vscode = {
enableUpdateCheck = false; enable = true;
extensions = with pkgs.vscode-extensions; [ package = pkgs.vscodium;
bbenoist.nix enableUpdateCheck = false;
ms-python.python extensions = with pkgs.vscode-extensions; [
kamadorueda.alejandra jnoortheen.nix-ide
editorconfig.editorconfig ms-python.python
yzhang.markdown-all-in-one editorconfig.editorconfig
redhat.vscode-yaml yzhang.markdown-all-in-one
pkief.material-icon-theme redhat.vscode-yaml
rust-lang.rust-analyzer pkief.material-icon-theme
tamasfe.even-better-toml rust-lang.rust-analyzer
llvm-vs-code-extensions.vscode-clangd tamasfe.even-better-toml
mkhl.direnv llvm-vs-code-extensions.vscode-clangd
vadimcn.vscode-lldb mkhl.direnv
ms-dotnettools.csharp vadimcn.vscode-lldb
ms-vscode-remote.remote-ssh ms-dotnettools.csharp
]; ms-vscode-remote.remote-ssh
userSettings = { ];
"files.autoSave" = "afterDelay"; userSettings = {
"files.autoSaveWhenNoErrors" = true; "files.autoSave" = "afterDelay";
"files.autoSaveWorkspaceFilesOnly" = true; "files.autoSaveWhenNoErrors" = true;
"files.autoSaveWorkspaceFilesOnly" = true;
"editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace";
"editor.fontLigatures" = true; "editor.fontLigatures" = true;
"editor.formatOnSave" = true; "editor.formatOnSave" = true;
"editor.formatOnSaveMode" = "modificationsIfAvailable"; "editor.formatOnSaveMode" = "modificationsIfAvailable";
"editor.minimap.autohide" = true; "editor.minimap.autohide" = true;
"workbench.startupEditor" = "readme"; "workbench.startupEditor" = "readme";
"workbench.enableExperiments" = false; "workbench.enableExperiments" = false;
"workbench.iconTheme" = "material-icon-theme"; "workbench.iconTheme" = "material-icon-theme";
"update.mode" = "none"; "update.mode" = "none";
"extensions.autoUpdate" = false; "extensions.autoUpdate" = false;
"extensions.autoCheckUpdates" = false; "extensions.autoCheckUpdates" = false;
"telemetry.telemetryLevel" = "off"; "telemetry.telemetryLevel" = "off";
"redhat.telemetry.enabled" = false; "redhat.telemetry.enabled" = false;
"git.autofetch" = true; "git.autofetch" = true;
"diffEditor.diffAlgorithm" = "advanced"; "diffEditor.diffAlgorithm" = "advanced";
"explorer.excludeGitIgnore" = true; "explorer.excludeGitIgnore" = true;
"markdown.extension.tableFormatter.normalizeIndentation" = true; "markdown.extension.tableFormatter.normalizeIndentation" = true;
"markdown.extension.toc.orderedList" = false; "markdown.extension.toc.orderedList" = false;
"rust-analyzer.checkOnSave.command" = "clippy"; "rust-analyzer.checkOnSave.command" = "clippy";
"\[makefile\]" = { "nix.formatterPath" = "${lib.getBin pkgs.nixfmt-rfc-style}/bin/nixfmt";
"editor.insertSpaces" = false;
"editor.detectIndentation" = false; "\[makefile\]" = {
"editor.insertSpaces" = false;
"editor.detectIndentation" = false;
};
"\[nix\]" = {
"editor.formatOnSave" = false;
};
}; };
}; };
}; };

View file

@ -1,60 +1,69 @@
{ pkgs, lib, ... }: { pkgs, lib, ... }:
{ {
config.programs.vscode = { config = {
enable = true; home.sessionVariables.NIXOS_OZONE_WL = "1";
package = pkgs.vscodium; programs.vscode = {
enableUpdateCheck = false; enable = true;
extensions = with pkgs.vscode-extensions; [ package = pkgs.vscodium;
bbenoist.nix enableUpdateCheck = false;
ms-python.python extensions = with pkgs.vscode-extensions; [
kamadorueda.alejandra jnoortheen.nix-ide
editorconfig.editorconfig ms-python.python
yzhang.markdown-all-in-one editorconfig.editorconfig
redhat.vscode-yaml yzhang.markdown-all-in-one
pkief.material-icon-theme redhat.vscode-yaml
rust-lang.rust-analyzer pkief.material-icon-theme
tamasfe.even-better-toml rust-lang.rust-analyzer
llvm-vs-code-extensions.vscode-clangd tamasfe.even-better-toml
mkhl.direnv llvm-vs-code-extensions.vscode-clangd
vadimcn.vscode-lldb mkhl.direnv
ms-dotnettools.csharp vadimcn.vscode-lldb
ms-vscode-remote.remote-ssh ms-dotnettools.csharp
RoweWilsonFrederiskHolme.wikitext ms-vscode-remote.remote-ssh
davidanson.vscode-markdownlint RoweWilsonFrederiskHolme.wikitext
]; davidanson.vscode-markdownlint
userSettings = { ];
"files.autoSave" = "afterDelay"; userSettings = {
"files.autoSaveWhenNoErrors" = true; "files.autoSave" = "afterDelay";
"files.autoSaveWorkspaceFilesOnly" = true; "files.autoSaveWhenNoErrors" = true;
"files.autoSaveWorkspaceFilesOnly" = true;
"editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace";
"editor.fontLigatures" = true; "editor.fontLigatures" = true;
"editor.formatOnSave" = true; "editor.formatOnSave" = true;
"editor.formatOnSaveMode" = "modificationsIfAvailable"; "editor.formatOnSaveMode" = "modificationsIfAvailable";
"editor.minimap.autohide" = true; "editor.minimap.autohide" = true;
"workbench.startupEditor" = "readme"; "workbench.startupEditor" = "readme";
"workbench.enableExperiments" = false; "workbench.enableExperiments" = false;
"workbench.iconTheme" = "material-icon-theme"; "workbench.iconTheme" = "material-icon-theme";
"update.mode" = "none"; "update.mode" = "none";
"extensions.autoUpdate" = false; "extensions.autoUpdate" = false;
"extensions.autoCheckUpdates" = false; "extensions.autoCheckUpdates" = false;
"telemetry.telemetryLevel" = "off"; "telemetry.telemetryLevel" = "off";
"redhat.telemetry.enabled" = false; "redhat.telemetry.enabled" = false;
"git.autofetch" = true; "git.autofetch" = true;
"git.path" = "${lib.getBin pkgs.git}/bin/git"; "git.path" = "${lib.getBin pkgs.git}/bin/git";
"diffEditor.diffAlgorithm" = "advanced"; "diffEditor.diffAlgorithm" = "advanced";
"explorer.excludeGitIgnore" = false; "explorer.excludeGitIgnore" = false;
"markdown.extension.tableFormatter.normalizeIndentation" = true; "markdown.extension.tableFormatter.normalizeIndentation" = true;
"markdown.extension.toc.orderedList" = false; "markdown.extension.toc.orderedList" = false;
"rust-analyzer.checkOnSave.command" = "clippy";
"\[makefile\]" = { "rust-analyzer.checkOnSave.command" = "clippy";
"editor.insertSpaces" = false;
"editor.detectIndentation" = false; "nix.formatterPath" = "${lib.getBin pkgs.nixfmt-rfc-style}/bin/nixfmt";
"\[makefile\]" = {
"editor.insertSpaces" = false;
"editor.detectIndentation" = false;
};
"\[nix\]" = {
"editor.formatOnSave" = false;
};
}; };
}; };
}; };