Moved user modules
This commit is contained in:
1 parent
9352fa2649
commit
0932432e11
80 files changed
+64
-6
No files matched your search
@@ -0,0 +1,74 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
with lib;
|
||||
let
|
||||
cfg = config.modules.vscode;
|
||||
theme = config.theming;
|
||||
in
|
||||
{
|
||||
options.modules.vscode = {
|
||||
enable = mkEnableOption "vscode";
|
||||
codeFont = mkOption {
|
||||
type = types.anything;
|
||||
default = theme.fonts.pkgs."Fira Code";
|
||||
};
|
||||
fallbackFont = mkOption {
|
||||
type = types.anything;
|
||||
default = theme.fonts.pkgs."Symbols Nerd Font Mono";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
modules.unfree.allowedPackages = [
|
||||
"vscode"
|
||||
"vscode-extension-github-copilot"
|
||||
"vscode-extension-github-copilot-chat"
|
||||
"vscode-extension-ms-vsliveshare-vsliveshare"
|
||||
];
|
||||
|
||||
theming.fonts.extraFonts = [ cfg.codeFont ];
|
||||
|
||||
programs.vscode = {
|
||||
enable = true;
|
||||
|
||||
mutableExtensionsDir = false;
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
eamodio.gitlens
|
||||
ms-vscode.hexeditor
|
||||
mkhl.direnv
|
||||
usernamehw.errorlens
|
||||
gruntfuggly.todo-tree
|
||||
github.copilot
|
||||
github.copilot-chat
|
||||
tomoki1207.pdf
|
||||
ms-vsliveshare.vsliveshare
|
||||
];
|
||||
|
||||
userSettings = {
|
||||
# Font setup
|
||||
# TODO: Move the conversion factor to theme settings
|
||||
"editor.fontFamily" = mkForce "'${cfg.codeFont.name}', '${cfg.fallbackFont.name}'";
|
||||
"editor.fontSize" = mkForce (cfg.codeFont.recommendedSize); # Convert pt to px
|
||||
"editor.fontLigatures" = true;
|
||||
"terminal.integrated.fontFamily" = mkForce "'${cfg.codeFont.name}', '${cfg.fallbackFont.name}'";
|
||||
"terminal.integrated.fontSize" = mkForce (cfg.codeFont.recommendedSize); # Convert pt to px
|
||||
|
||||
# Formatting
|
||||
"editor.formatOnSave" = true;
|
||||
"editor.tabSize" = 4;
|
||||
|
||||
# Layout
|
||||
"window.menuBarVisibility" = "hidden";
|
||||
|
||||
# Git settings
|
||||
"git.autofetch" = true;
|
||||
"git.enableSmartCommit" = false;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user