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,13 +1,14 @@
{ pkgs, ... }: { pkgs, lib, ... }:
{ {
config.programs.vscode = { config = {
home.sessionVariables.NIXOS_OZONE_WL = "1";
programs.vscode = {
enable = true; enable = true;
package = pkgs.vscodium; package = pkgs.vscodium;
enableUpdateCheck = false; enableUpdateCheck = false;
extensions = with pkgs.vscode-extensions; [ extensions = with pkgs.vscode-extensions; [
bbenoist.nix jnoortheen.nix-ide
ms-python.python ms-python.python
kamadorueda.alejandra
editorconfig.editorconfig editorconfig.editorconfig
yzhang.markdown-all-in-one yzhang.markdown-all-in-one
redhat.vscode-yaml redhat.vscode-yaml
@ -49,10 +50,17 @@
"markdown.extension.toc.orderedList" = false; "markdown.extension.toc.orderedList" = false;
"rust-analyzer.checkOnSave.command" = "clippy"; "rust-analyzer.checkOnSave.command" = "clippy";
"nix.formatterPath" = "${lib.getBin pkgs.nixfmt-rfc-style}/bin/nixfmt";
"\[makefile\]" = { "\[makefile\]" = {
"editor.insertSpaces" = false; "editor.insertSpaces" = false;
"editor.detectIndentation" = false; "editor.detectIndentation" = false;
}; };
"\[nix\]" = {
"editor.formatOnSave" = false;
};
};
}; };
}; };
} }

View file

@ -1,13 +1,14 @@
{ pkgs, lib, ... }: { pkgs, lib, ... }:
{ {
config.programs.vscode = { config = {
home.sessionVariables.NIXOS_OZONE_WL = "1";
programs.vscode = {
enable = true; enable = true;
package = pkgs.vscodium; package = pkgs.vscodium;
enableUpdateCheck = false; enableUpdateCheck = false;
extensions = with pkgs.vscode-extensions; [ extensions = with pkgs.vscode-extensions; [
bbenoist.nix jnoortheen.nix-ide
ms-python.python ms-python.python
kamadorueda.alejandra
editorconfig.editorconfig editorconfig.editorconfig
yzhang.markdown-all-in-one yzhang.markdown-all-in-one
redhat.vscode-yaml redhat.vscode-yaml
@ -50,12 +51,20 @@
"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"; "rust-analyzer.checkOnSave.command" = "clippy";
"nix.formatterPath" = "${lib.getBin pkgs.nixfmt-rfc-style}/bin/nixfmt";
"\[makefile\]" = { "\[makefile\]" = {
"editor.insertSpaces" = false; "editor.insertSpaces" = false;
"editor.detectIndentation" = false; "editor.detectIndentation" = false;
}; };
"\[nix\]" = {
"editor.formatOnSave" = false;
};
};
}; };
}; };
} }