feat: vscode extension fixes & patching

This commit is contained in:
winston 2023-12-19 17:55:23 +01:00
parent 8735eb323f
commit 107242b385
Signed by: winston
GPG key ID: 3786770EDBC2B481
4 changed files with 118 additions and 45 deletions

View file

@ -43,6 +43,7 @@
".gonvim/" ".gonvim/"
".idea/" ".idea/"
"ltex.dictionary*.txt" "ltex.dictionary*.txt"
"ltex.disabledRules.*.txt"
# nix-specific # nix-specific
".direnv/" ".direnv/"
".envrc" ".envrc"

View file

@ -9,13 +9,69 @@
settingsJSON = config.lib.file.mkOutOfStoreSymlink "${flakePath}/home/apps/vscode/settings.json"; settingsJSON = config.lib.file.mkOutOfStoreSymlink "${flakePath}/home/apps/vscode/settings.json";
keybindingsJSON = config.lib.file.mkOutOfStoreSymlink "${flakePath}/home/apps/vscode/keybindings.json"; keybindingsJSON = config.lib.file.mkOutOfStoreSymlink "${flakePath}/home/apps/vscode/keybindings.json";
snippetsDir = config.lib.file.mkOutOfStoreSymlink "${flakePath}/home/apps/vscode/snippets";
in { in {
programs.vscode = { programs.vscode = {
enable = config.isGraphical; enable = config.isGraphical;
extensions = with pkgs.vscode-marketplace; [ extensions =
pkgs.vscode-extensions.valentjn.vscode-ltex (with pkgs.vscode-extensions; [
# patches
ms-vscode-remote.remote-ssh
sumneko.lua
# needs a pinned release
github.vscode-pull-request-github
# pulling in extra binaries, patched for nix
valentjn.vscode-ltex
])
# pinned releases; these install the latest rather than the nightly version
++ (with pkgs.vscode-marketplace-release; [
eamodio.gitlens
rust-lang.rust-analyzer
vadimcn.vscode-lldb
])
++ (with pkgs.vscode-marketplace; [
# some default config patching to make these work without needing devShells all the time.
# other extensions like Go/Rust are only really used with devShells,
# nix & shell are universal enough for me to want them everywhere.
(jnoortheen.nix-ide.overrideAttrs (prev: {
nativeBuildInputs = prev.nativeBuildInputs ++ [pkgs.jq pkgs.moreutils];
postInstall = ''
cd "$out/$installPrefix"
jq -e '
.contributes.configuration.properties."nix.formatterPath".default =
"${pkgs.alejandra}/bin/alejandra" |
.contributes.configuration.properties."nix.enableLanguageServer".default =
"true" |
.contributes.configuration.properties."nix.serverPath".default =
"${pkgs.nil}/bin/nil" |
.contributes.configuration.properties."nix.serverSettings".default.nil.formatting.command[0] =
"${pkgs.alejandra}/bin/alejandra"
' < package.json | sponge package.json
'';
}))
(mads-hartmann.bash-ide-vscode.overrideAttrs (prev: {
nativeBuildInputs = prev.nativeBuildInputs ++ [pkgs.jq pkgs.moreutils];
postInstall = ''
cd "$out/$installPrefix"
jq -e '
.contributes.configuration.properties."bashIde.shellcheckPath".default =
"${pkgs.shellcheck}/bin/shellcheck"
' < package.json | sponge package.json
'';
}))
(mkhl.shfmt.overrideAttrs (prev: {
nativeBuildInputs = prev.nativeBuildInputs ++ [pkgs.jq pkgs.moreutils];
postInstall = ''
cd "$out/$installPrefix"
jq -e '
.contributes.configuration.properties."shfmt.executablePath".default =
"${pkgs.shfmt}/bin/shfmt"
' < package.json | sponge package.json
'';
}))
adrianwilczynski.alpine-js-intellisense adrianwilczynski.alpine-js-intellisense
antfu.icons-carbon antfu.icons-carbon
arcanis.vscode-zipfs
astro-build.astro-vscode astro-build.astro-vscode
bradlc.vscode-tailwindcss bradlc.vscode-tailwindcss
catppuccin.catppuccin-vsc-icons catppuccin.catppuccin-vsc-icons
@ -24,45 +80,45 @@ in {
denoland.vscode-deno denoland.vscode-deno
dhall.dhall-lang dhall.dhall-lang
dhall.vscode-dhall-lsp-server dhall.vscode-dhall-lsp-server
eamodio.gitlens
editorconfig.editorconfig editorconfig.editorconfig
esbenp.prettier-vscode esbenp.prettier-vscode
github.copilot github.copilot
github.vscode-pull-request-github
gitlab.gitlab-workflow gitlab.gitlab-workflow
golang.go golang.go
graphql.vscode-graphql-syntax graphql.vscode-graphql-syntax
jnoortheen.nix-ide jock.svg
kamadorueda.alejandra
leonardssh.vscord
lunuan.kubernetes-templates lunuan.kubernetes-templates
mads-hartmann.bash-ide-vscode
mikestead.dotenv mikestead.dotenv
mkhl.direnv mkhl.direnv
mkhl.shfmt
ms-kubernetes-tools.vscode-kubernetes-tools ms-kubernetes-tools.vscode-kubernetes-tools
oscarotero.vento-syntax
pkief.material-icon-theme pkief.material-icon-theme
redhat.vscode-yaml redhat.vscode-yaml
rust-lang.rust-analyzer
serayuzgur.crates serayuzgur.crates
sumneko.lua
tamasfe.even-better-toml tamasfe.even-better-toml
tomoki1207.pdf tomoki1207.pdf
unifiedjs.vscode-mdx unifiedjs.vscode-mdx
usernamehw.errorlens usernamehw.errorlens
vscodevim.vim vscodevim.vim
webfreak.code-d ]);
];
mutableExtensionsDir = true; mutableExtensionsDir = true;
}; };
home.file = lib.mkIf isDarwin { home.file = lib.mkIf isDarwin {
"Library/Application Support/Code/User/keybindings.json".source = keybindingsJSON; "Library/Application Support/Code/User/keybindings.json".source = keybindingsJSON;
"Library/Application Support/Code/User/settings.json".source = settingsJSON; "Library/Application Support/Code/User/settings.json".source = settingsJSON;
"Library/Application Support/Code/User/snippets" = {
source = snippetsDir;
recursive = true;
};
}; };
xdg.configFile = lib.mkIf isLinux { xdg.configFile = lib.mkIf isLinux {
"Code/User/keybindings.json".source = keybindingsJSON; "Code/User/keybindings.json".source = keybindingsJSON;
"Code/User/settings.json".source = settingsJSON; "Code/User/settings.json".source = settingsJSON;
"Code/User/snippets" = {
source = snippetsDir;
recursive = true;
};
}; };
xdg.mimeApps.defaultApplications."text/plain" = "code.desktop"; xdg.mimeApps.defaultApplications."text/plain" = "code.desktop";
} }

View file

@ -31,6 +31,7 @@
"extensions.ignoreRecommendations": true, "extensions.ignoreRecommendations": true,
"git.autofetch": true, "git.autofetch": true,
"git.openRepositoryInParentFolders": "never", "git.openRepositoryInParentFolders": "never",
"githubPullRequests.pullBranch": "always",
"ltex.additionalRules.enablePickyRules": true, "ltex.additionalRules.enablePickyRules": true,
"ltex.additionalRules.motherTongue": "de-AT", "ltex.additionalRules.motherTongue": "de-AT",
"markdown.preview.fontFamily": "IBM Plex Sans, sans-serif", "markdown.preview.fontFamily": "IBM Plex Sans, sans-serif",
@ -39,7 +40,8 @@
"typescript.inlayHints.parameterNames.enabled": "all", "typescript.inlayHints.parameterNames.enabled": "all",
"update.mode": "none", "update.mode": "none",
"vs-kubernetes": { "vs-kubernetes": {
"vs-kubernetes.crd-code-completion": "enabled" "vs-kubernetes.crd-code-completion": "enabled",
"vs-kubernetes.minikube-show-information-expiration": "2024-06-09T06:56:22.175Z"
}, },
"window.autoDetectColorScheme": true, "window.autoDetectColorScheme": true,
"window.commandCenter": false, "window.commandCenter": false,
@ -79,9 +81,9 @@
"[less]": { "[less]": {
"editor.defaultFormatter": "esbenp.prettier-vscode" "editor.defaultFormatter": "esbenp.prettier-vscode"
}, },
"nix.enableLanguageServer": true, "[nix]": {
"nix.formatterPath": "alejandra", "editor.defaultFormatter": "jnoortheen.nix-ide"
"nix.serverPath": "nil", },
"[python]": { "[python]": {
"editor.defaultFormatter": "charliermarsh.ruff" "editor.defaultFormatter": "charliermarsh.ruff"
}, },

View file

@ -0,0 +1,14 @@
{
"mkShell": {
"prefix": "mkshell",
"body": [
"{pkgs ? import <nixpkgs> {}}:",
"pkgs.mkShell {",
" buildInputs = with pkgs; [",
" $1",
" ];",
"}"
],
"description": "Nix development shell"
}
}