dotfiles/homes/modules/editor/vscode.nix

134 lines
3.7 KiB
Nix

{
config,
lib,
pkgs,
vscodium ? false,
secret-service ? "gnome-libsecret",
vscode-argv ? ".vscode/argv.json",
...
}: {
nixpkgs.overlays = [
(
self: super: {
vscode-extensions = super.vscode-extensions.overrideAttrs (prev: let
mkVscMarketplaceExtension = {
publisher,
name,
version,
hash,
description ? "",
homepage ? null,
changelog ? null,
license ? null,
maintainers ? [lib.maintainers.emileclarkb],
}:
with pkgs.vscode-utils.buildVscodeMarketplaceExtension; {
${publisher}.${name} = buildVscodeMarketplaceExtension {
mktplcRef = {
inherit
publisher
name
version
hash
;
};
meta = {
inherit
(
if license != null
then {license = license;}
else {}
)
description
homepage
maintainers
;
downloadPage = "https://marketplace.visualstudio.com/items?itemName=${publisher}.${name}";
changelog =
if changelog != null
then changelog
else "https://marketplace.visualstudio.com/items/${publisher}.${name}/changelog";
};
};
};
in
lib.mergeAttrsList [
(mkVscMarketplaceExtension {
publisher = "ms-dotnettools";
name = "dotnet-maui";
version = "1.11.14";
hash = lib.fakeHash;
description = "Extend C# Dev Kit with tools for building .NET Multi-platform App UI (MAUI) apps";
homepage = "https://github.com/microsoft/vscode-dotnettools";
license = lib.licenses.unfree;
})
]);
}
)
];
# REF: https://home-manager-options.extranix.com/?query=vscode&release=release-25.05
programs.vscode = {
enable = true;
# TODO: clean up
package =
(
if vscodium
then pkgs.vscodium
else pkgs.vscode
).overrideAttrs (oldAttrs: {
# runtimeDependencies = oldAttrs.runtimeDependencies ++ []
});
mutableExtensionsDir = true;
profiles.default = {
enableUpdateCheck = false;
enableExtensionUpdateCheck = false;
# extension format: USER.PACKAGENAME
extensions = with pkgs.vscode-extensions; [
# .NET
ms-dotnettools.csharp
ms-dotnettools.csdevkit
ms-dotnettools.vscode-dotnet-runtime
# TODO: these extensions aren't packaged :(
# deitry.solution-syntax
# ms-dotnettools.vscode-dotnet-pack
# ms-dotnettools.dotnet-maui
# Python
ms-python.python
# GitLens by GitKraken
eamodio.gitlens
ms-azuretools.vscode-docker
github.copilot
github.copilot-chat
# Colors & Themes
dracula-theme.theme-dracula
catppuccin.catppuccin-vsc
catppuccin.catppuccin-vsc-icons
mvllow.rose-pine
];
userSettings = {
"workbench.colorTheme" = "Dracula Theme";
"github.copilot.nextEditSuggestions.enabled" = true;
};
};
};
# TODO: this is super ugly, make sure the JSON is formatted!!
home.file.${vscode-argv}.text = builtins.toJSON {
password-store = secret-service;
disable-hardware-acceleration = false;
disable-color-correct-rendering = false;
enable-crash-reporter = false;
# crash-report-id = ...;
};
}