3d2e74d115
Add a new module for Visual Studio Code configuration including default extensions (nix-ide, markdown-all-in-one, prettier) and nixd/nixfmt settings. Enable vscode on 14900k, t2mbp, and uConsole hosts with additional extensions. Also clean up unfree predicate logic in ideapad configuration.
62 lines
1.9 KiB
Nix
62 lines
1.9 KiB
Nix
# Visual Studio Code (Microsoft build, unfree). Default extensions + settings shared by all
|
|
# hosts; per-host extras (peacock, comment-anchors, project-manager) go via
|
|
# `chiasson.home.editors.vscode.extensions`.
|
|
{ self, ... }: {
|
|
flake.homeManagerModules.wisdomEditorsVscode =
|
|
{ config, lib, pkgs, ... }:
|
|
let
|
|
root = config.chiasson.home;
|
|
cfg = config.chiasson.home.editors.vscode;
|
|
|
|
defaultExtensions = with pkgs.vscode-extensions; [
|
|
jnoortheen.nix-ide
|
|
yzhang.markdown-all-in-one
|
|
esbenp.prettier-vscode
|
|
];
|
|
|
|
coreSettings = {
|
|
"nix.enableLanguageServer" = true;
|
|
"nix.serverPath" = "nixd";
|
|
"nix.serverSettings" = {
|
|
nixd = {
|
|
formatting = {
|
|
command = "nixfmt";
|
|
};
|
|
};
|
|
};
|
|
"diffEditor.ignoreTrimWhitespace" = false;
|
|
"chat.disableAIFeatures" = true;
|
|
};
|
|
in
|
|
{
|
|
options.chiasson.home.editors.vscode = {
|
|
enable = lib.mkEnableOption ''
|
|
Visual Studio Code (Microsoft build; needs `nixpkgs.config.allowUnfree`). Core
|
|
extensions (nix-ide, markdown-all-in-one, prettier) + nixd/nixfmt settings are included.
|
|
'' // {
|
|
default = false;
|
|
};
|
|
|
|
extensions = lib.mkOption {
|
|
type = lib.types.listOf lib.types.package;
|
|
default = [ ];
|
|
description = ''
|
|
Extra extensions not wanted on every host (e.g. peacock, comment-anchors,
|
|
project-manager). Per-host via `chiasson.users.extraModules`.
|
|
'';
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf (root.enable && cfg.enable) {
|
|
home.packages = [ pkgs.vscode ];
|
|
|
|
programs.vscode = {
|
|
enable = true;
|
|
package = pkgs.vscode;
|
|
extensions = defaultExtensions ++ cfg.extensions;
|
|
userSettings = coreSettings;
|
|
};
|
|
};
|
|
};
|
|
}
|