dotfiles/home/apps/vscode.nix

142 lines
5 KiB
Nix
Raw Normal View History

2023-02-10 07:46:37 +01:00
{
config,
flakePath,
lib,
2023-02-10 07:46:37 +01:00
pkgs,
2024-02-23 10:13:54 +01:00
isNixOS,
2023-02-10 07:46:37 +01:00
...
}: let
inherit (pkgs.stdenv.hostPlatform) isDarwin isLinux;
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";
2023-02-10 07:46:37 +01:00
in {
programs.vscode = {
2023-11-28 12:21:17 +01:00
enable = config.isGraphical;
extensions =
(with pkgs.vscode-extensions; [
# patches
2024-02-15 18:49:22 +01:00
ms-python.python
ms-python.vscode-pylance
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
2024-01-03 14:57:03 +01:00
bashmish.es6-string-css
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
2024-02-15 18:49:22 +01:00
geequlim.godot-tools
github.copilot
2024-01-03 14:57:03 +01:00
github.vscode-github-actions
gitlab.gitlab-workflow
golang.go
graphql.vscode-graphql-syntax
2024-01-03 14:57:03 +01:00
gruntfuggly.todo-tree
jock.svg
2024-02-15 18:49:22 +01:00
leonardssh.vscord
lunuan.kubernetes-templates
mikestead.dotenv
mkhl.direnv
ms-kubernetes-tools.vscode-kubernetes-tools
2024-01-03 14:57:03 +01:00
ms-vscode.live-server
oscarotero.vento-syntax
redhat.vscode-yaml
2024-01-03 14:57:03 +01:00
ryanluker.vscode-coverage-gutters
serayuzgur.crates
tamasfe.even-better-toml
2024-01-03 14:57:03 +01:00
tobermory.es6-string-html
tomoki1207.pdf
unifiedjs.vscode-mdx
usernamehw.errorlens
vscodevim.vim
2024-02-15 18:49:22 +01:00
wakatime.vscode-wakatime
]);
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";
2024-02-23 10:13:54 +01:00
services.vscode-server = {
# when using a non-nixOS system, there's no need to patch the server
enable = isNixOS;
nodejsPackage = pkgs.nodejs_18;
};
}