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,60 +9,116 @@
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; [
adrianwilczynski.alpine-js-intellisense # patches
antfu.icons-carbon ms-vscode-remote.remote-ssh
astro-build.astro-vscode sumneko.lua
bradlc.vscode-tailwindcss # needs a pinned release
catppuccin.catppuccin-vsc-icons github.vscode-pull-request-github
charliermarsh.ruff # pulling in extra binaries, patched for nix
dbaeumer.vscode-eslint valentjn.vscode-ltex
denoland.vscode-deno ])
dhall.dhall-lang # pinned releases; these install the latest rather than the nightly version
dhall.vscode-dhall-lsp-server ++ (with pkgs.vscode-marketplace-release; [
eamodio.gitlens eamodio.gitlens
editorconfig.editorconfig rust-lang.rust-analyzer
esbenp.prettier-vscode vadimcn.vscode-lldb
github.copilot ])
github.vscode-pull-request-github ++ (with pkgs.vscode-marketplace; [
gitlab.gitlab-workflow # some default config patching to make these work without needing devShells all the time.
golang.go # other extensions like Go/Rust are only really used with devShells,
graphql.vscode-graphql-syntax # nix & shell are universal enough for me to want them everywhere.
jnoortheen.nix-ide (jnoortheen.nix-ide.overrideAttrs (prev: {
kamadorueda.alejandra nativeBuildInputs = prev.nativeBuildInputs ++ [pkgs.jq pkgs.moreutils];
leonardssh.vscord postInstall = ''
lunuan.kubernetes-templates cd "$out/$installPrefix"
mads-hartmann.bash-ide-vscode jq -e '
mikestead.dotenv .contributes.configuration.properties."nix.formatterPath".default =
mkhl.direnv "${pkgs.alejandra}/bin/alejandra" |
mkhl.shfmt .contributes.configuration.properties."nix.enableLanguageServer".default =
ms-kubernetes-tools.vscode-kubernetes-tools "true" |
pkief.material-icon-theme .contributes.configuration.properties."nix.serverPath".default =
redhat.vscode-yaml "${pkgs.nil}/bin/nil" |
rust-lang.rust-analyzer .contributes.configuration.properties."nix.serverSettings".default.nil.formatting.command[0] =
serayuzgur.crates "${pkgs.alejandra}/bin/alejandra"
sumneko.lua ' < package.json | sponge package.json
tamasfe.even-better-toml '';
tomoki1207.pdf }))
unifiedjs.vscode-mdx (mads-hartmann.bash-ide-vscode.overrideAttrs (prev: {
usernamehw.errorlens nativeBuildInputs = prev.nativeBuildInputs ++ [pkgs.jq pkgs.moreutils];
vscodevim.vim postInstall = ''
webfreak.code-d 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
antfu.icons-carbon
arcanis.vscode-zipfs
astro-build.astro-vscode
bradlc.vscode-tailwindcss
catppuccin.catppuccin-vsc-icons
charliermarsh.ruff
dbaeumer.vscode-eslint
denoland.vscode-deno
dhall.dhall-lang
dhall.vscode-dhall-lsp-server
editorconfig.editorconfig
esbenp.prettier-vscode
github.copilot
gitlab.gitlab-workflow
golang.go
graphql.vscode-graphql-syntax
jock.svg
lunuan.kubernetes-templates
mikestead.dotenv
mkhl.direnv
ms-kubernetes-tools.vscode-kubernetes-tools
oscarotero.vento-syntax
pkief.material-icon-theme
redhat.vscode-yaml
serayuzgur.crates
tamasfe.even-better-toml
tomoki1207.pdf
unifiedjs.vscode-mdx
usernamehw.errorlens
vscodevim.vim
]);
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"
}
}