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/"
".idea/"
"ltex.dictionary*.txt"
"ltex.disabledRules.*.txt"
# nix-specific
".direnv/"
".envrc"

View file

@ -9,60 +9,116 @@
settingsJSON = config.lib.file.mkOutOfStoreSymlink "${flakePath}/home/apps/vscode/settings.json";
keybindingsJSON = config.lib.file.mkOutOfStoreSymlink "${flakePath}/home/apps/vscode/keybindings.json";
snippetsDir = config.lib.file.mkOutOfStoreSymlink "${flakePath}/home/apps/vscode/snippets";
in {
programs.vscode = {
enable = config.isGraphical;
extensions = with pkgs.vscode-marketplace; [
pkgs.vscode-extensions.valentjn.vscode-ltex
adrianwilczynski.alpine-js-intellisense
antfu.icons-carbon
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
eamodio.gitlens
editorconfig.editorconfig
esbenp.prettier-vscode
github.copilot
github.vscode-pull-request-github
gitlab.gitlab-workflow
golang.go
graphql.vscode-graphql-syntax
jnoortheen.nix-ide
kamadorueda.alejandra
leonardssh.vscord
lunuan.kubernetes-templates
mads-hartmann.bash-ide-vscode
mikestead.dotenv
mkhl.direnv
mkhl.shfmt
ms-kubernetes-tools.vscode-kubernetes-tools
pkief.material-icon-theme
redhat.vscode-yaml
rust-lang.rust-analyzer
serayuzgur.crates
sumneko.lua
tamasfe.even-better-toml
tomoki1207.pdf
unifiedjs.vscode-mdx
usernamehw.errorlens
vscodevim.vim
webfreak.code-d
];
extensions =
(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
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;
};
home.file = lib.mkIf isDarwin {
"Library/Application Support/Code/User/keybindings.json".source = keybindingsJSON;
"Library/Application Support/Code/User/settings.json".source = settingsJSON;
"Library/Application Support/Code/User/snippets" = {
source = snippetsDir;
recursive = true;
};
};
xdg.configFile = lib.mkIf isLinux {
"Code/User/keybindings.json".source = keybindingsJSON;
"Code/User/settings.json".source = settingsJSON;
"Code/User/snippets" = {
source = snippetsDir;
recursive = true;
};
};
xdg.mimeApps.defaultApplications."text/plain" = "code.desktop";
}

View file

@ -31,6 +31,7 @@
"extensions.ignoreRecommendations": true,
"git.autofetch": true,
"git.openRepositoryInParentFolders": "never",
"githubPullRequests.pullBranch": "always",
"ltex.additionalRules.enablePickyRules": true,
"ltex.additionalRules.motherTongue": "de-AT",
"markdown.preview.fontFamily": "IBM Plex Sans, sans-serif",
@ -39,7 +40,8 @@
"typescript.inlayHints.parameterNames.enabled": "all",
"update.mode": "none",
"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.commandCenter": false,
@ -79,9 +81,9 @@
"[less]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"nix.enableLanguageServer": true,
"nix.formatterPath": "alejandra",
"nix.serverPath": "nil",
"[nix]": {
"editor.defaultFormatter": "jnoortheen.nix-ide"
},
"[python]": {
"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"
}
}