From b6ad841847674cc38cae536f41083fd525bf90f8 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 18 May 2025 11:03:25 +0200 Subject: [PATCH] configure vscode nix formatting --- home/ronja/vscode.nix | 102 ++++++++++++++++++++------------------ home/vinzenz/vscode.nix | 107 ++++++++++++++++++++++------------------ 2 files changed, 113 insertions(+), 96 deletions(-) diff --git a/home/ronja/vscode.nix b/home/ronja/vscode.nix index 79ab666..7b37dd6 100644 --- a/home/ronja/vscode.nix +++ b/home/ronja/vscode.nix @@ -1,57 +1,65 @@ -{ pkgs, ... }: +{ pkgs, lib, ... }: { - config.programs.vscode = { - enable = true; - package = pkgs.vscodium; - enableUpdateCheck = false; - extensions = with pkgs.vscode-extensions; [ - bbenoist.nix - ms-python.python - kamadorueda.alejandra - editorconfig.editorconfig - yzhang.markdown-all-in-one - redhat.vscode-yaml - pkief.material-icon-theme - rust-lang.rust-analyzer - tamasfe.even-better-toml - llvm-vs-code-extensions.vscode-clangd - mkhl.direnv - vadimcn.vscode-lldb - ms-dotnettools.csharp - ms-vscode-remote.remote-ssh - ]; - userSettings = { - "files.autoSave" = "afterDelay"; - "files.autoSaveWhenNoErrors" = true; - "files.autoSaveWorkspaceFilesOnly" = true; + config = { + home.sessionVariables.NIXOS_OZONE_WL = "1"; + programs.vscode = { + enable = true; + package = pkgs.vscodium; + enableUpdateCheck = false; + extensions = with pkgs.vscode-extensions; [ + jnoortheen.nix-ide + ms-python.python + editorconfig.editorconfig + yzhang.markdown-all-in-one + redhat.vscode-yaml + pkief.material-icon-theme + rust-lang.rust-analyzer + tamasfe.even-better-toml + llvm-vs-code-extensions.vscode-clangd + mkhl.direnv + vadimcn.vscode-lldb + ms-dotnettools.csharp + ms-vscode-remote.remote-ssh + ]; + userSettings = { + "files.autoSave" = "afterDelay"; + "files.autoSaveWhenNoErrors" = true; + "files.autoSaveWorkspaceFilesOnly" = true; - "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; - "editor.fontLigatures" = true; - "editor.formatOnSave" = true; - "editor.formatOnSaveMode" = "modificationsIfAvailable"; - "editor.minimap.autohide" = true; + "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; + "editor.fontLigatures" = true; + "editor.formatOnSave" = true; + "editor.formatOnSaveMode" = "modificationsIfAvailable"; + "editor.minimap.autohide" = true; - "workbench.startupEditor" = "readme"; - "workbench.enableExperiments" = false; - "workbench.iconTheme" = "material-icon-theme"; + "workbench.startupEditor" = "readme"; + "workbench.enableExperiments" = false; + "workbench.iconTheme" = "material-icon-theme"; - "update.mode" = "none"; - "extensions.autoUpdate" = false; - "extensions.autoCheckUpdates" = false; + "update.mode" = "none"; + "extensions.autoUpdate" = false; + "extensions.autoCheckUpdates" = false; - "telemetry.telemetryLevel" = "off"; - "redhat.telemetry.enabled" = false; + "telemetry.telemetryLevel" = "off"; + "redhat.telemetry.enabled" = false; - "git.autofetch" = true; - "diffEditor.diffAlgorithm" = "advanced"; - "explorer.excludeGitIgnore" = true; - "markdown.extension.tableFormatter.normalizeIndentation" = true; - "markdown.extension.toc.orderedList" = false; - "rust-analyzer.checkOnSave.command" = "clippy"; + "git.autofetch" = true; + "diffEditor.diffAlgorithm" = "advanced"; + "explorer.excludeGitIgnore" = true; + "markdown.extension.tableFormatter.normalizeIndentation" = true; + "markdown.extension.toc.orderedList" = false; + "rust-analyzer.checkOnSave.command" = "clippy"; - "\[makefile\]" = { - "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; + }; }; }; }; diff --git a/home/vinzenz/vscode.nix b/home/vinzenz/vscode.nix index dca318b..15f747e 100644 --- a/home/vinzenz/vscode.nix +++ b/home/vinzenz/vscode.nix @@ -1,60 +1,69 @@ { pkgs, lib, ... }: { - config.programs.vscode = { - enable = true; - package = pkgs.vscodium; - enableUpdateCheck = false; - extensions = with pkgs.vscode-extensions; [ - bbenoist.nix - ms-python.python - kamadorueda.alejandra - editorconfig.editorconfig - yzhang.markdown-all-in-one - redhat.vscode-yaml - pkief.material-icon-theme - rust-lang.rust-analyzer - tamasfe.even-better-toml - llvm-vs-code-extensions.vscode-clangd - mkhl.direnv - vadimcn.vscode-lldb - ms-dotnettools.csharp - ms-vscode-remote.remote-ssh - RoweWilsonFrederiskHolme.wikitext - davidanson.vscode-markdownlint - ]; - userSettings = { - "files.autoSave" = "afterDelay"; - "files.autoSaveWhenNoErrors" = true; - "files.autoSaveWorkspaceFilesOnly" = true; + config = { + home.sessionVariables.NIXOS_OZONE_WL = "1"; + programs.vscode = { + enable = true; + package = pkgs.vscodium; + enableUpdateCheck = false; + extensions = with pkgs.vscode-extensions; [ + jnoortheen.nix-ide + ms-python.python + editorconfig.editorconfig + yzhang.markdown-all-in-one + redhat.vscode-yaml + pkief.material-icon-theme + rust-lang.rust-analyzer + tamasfe.even-better-toml + llvm-vs-code-extensions.vscode-clangd + mkhl.direnv + vadimcn.vscode-lldb + ms-dotnettools.csharp + ms-vscode-remote.remote-ssh + RoweWilsonFrederiskHolme.wikitext + davidanson.vscode-markdownlint + ]; + userSettings = { + "files.autoSave" = "afterDelay"; + "files.autoSaveWhenNoErrors" = true; + "files.autoSaveWorkspaceFilesOnly" = true; - "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; - "editor.fontLigatures" = true; - "editor.formatOnSave" = true; - "editor.formatOnSaveMode" = "modificationsIfAvailable"; - "editor.minimap.autohide" = true; + "editor.fontFamily" = "'Fira Code', 'Droid Sans Mono', 'monospace', monospace"; + "editor.fontLigatures" = true; + "editor.formatOnSave" = true; + "editor.formatOnSaveMode" = "modificationsIfAvailable"; + "editor.minimap.autohide" = true; - "workbench.startupEditor" = "readme"; - "workbench.enableExperiments" = false; - "workbench.iconTheme" = "material-icon-theme"; + "workbench.startupEditor" = "readme"; + "workbench.enableExperiments" = false; + "workbench.iconTheme" = "material-icon-theme"; - "update.mode" = "none"; - "extensions.autoUpdate" = false; - "extensions.autoCheckUpdates" = false; + "update.mode" = "none"; + "extensions.autoUpdate" = false; + "extensions.autoCheckUpdates" = false; - "telemetry.telemetryLevel" = "off"; - "redhat.telemetry.enabled" = false; + "telemetry.telemetryLevel" = "off"; + "redhat.telemetry.enabled" = false; - "git.autofetch" = true; - "git.path" = "${lib.getBin pkgs.git}/bin/git"; - "diffEditor.diffAlgorithm" = "advanced"; - "explorer.excludeGitIgnore" = false; - "markdown.extension.tableFormatter.normalizeIndentation" = true; - "markdown.extension.toc.orderedList" = false; - "rust-analyzer.checkOnSave.command" = "clippy"; + "git.autofetch" = true; + "git.path" = "${lib.getBin pkgs.git}/bin/git"; + "diffEditor.diffAlgorithm" = "advanced"; + "explorer.excludeGitIgnore" = false; + "markdown.extension.tableFormatter.normalizeIndentation" = true; + "markdown.extension.toc.orderedList" = false; - "\[makefile\]" = { - "editor.insertSpaces" = false; - "editor.detectIndentation" = false; + "rust-analyzer.checkOnSave.command" = "clippy"; + + "nix.formatterPath" = "${lib.getBin pkgs.nixfmt-rfc-style}/bin/nixfmt"; + + "\[makefile\]" = { + "editor.insertSpaces" = false; + "editor.detectIndentation" = false; + }; + + "\[nix\]" = { + "editor.formatOnSave" = false; + }; }; }; };