Reorganize imports
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
124
hosts/common/configs/user/gui/vscode/default.nix
Normal file
124
hosts/common/configs/user/gui/vscode/default.nix
Normal file
@@ -0,0 +1,124 @@
|
||||
{
|
||||
user ? throw "user argument is required",
|
||||
home ? throw "home argument is required",
|
||||
}:
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
let
|
||||
hmConfig = config.home-manager.users.${user};
|
||||
in
|
||||
{
|
||||
environment.persistence = {
|
||||
"/persist"."${home}/.config/Code" = { };
|
||||
# Bastard: https://github.com/microsoft/vscode/issues/3884
|
||||
"/cache" = {
|
||||
"${home}/.config/Code/Cache" = { };
|
||||
"${home}/.config/Code/CachedConfigurations" = { };
|
||||
"${home}/.config/Code/CachedData" = { };
|
||||
"${home}/.config/Code/CachedExtensionVSIXs" = { };
|
||||
"${home}/.config/Code/CachedExtensions" = { };
|
||||
"${home}/.config/Code/CachedProfilesData" = { };
|
||||
"${home}/.config/Code/Code Cache" = { };
|
||||
"${home}/.config/Code/DawnCache" = { };
|
||||
"${home}/.config/Code/GPUCache" = { };
|
||||
"${home}/.config/Code/Service Worker/CacheStorage" = { };
|
||||
"${home}/.config/Code/Service Worker/ScriptCache" = { };
|
||||
};
|
||||
};
|
||||
|
||||
home-manager.users.${user} = {
|
||||
programs.vscode = {
|
||||
enable = true;
|
||||
|
||||
mutableExtensionsDir = false;
|
||||
|
||||
extensions = with pkgs.vscode-extensions; [
|
||||
mkhl.direnv
|
||||
mhutchie.git-graph
|
||||
ms-azuretools.vscode-docker
|
||||
ms-vsliveshare.vsliveshare
|
||||
github.copilot
|
||||
naumovs.color-highlight
|
||||
signageos.signageos-vscode-sops
|
||||
];
|
||||
|
||||
userSettings = {
|
||||
"diffEditor.ignoreTrimWhitespace" = false;
|
||||
"editor.accessibilitySupport" = "off";
|
||||
"editor.cursorBlinking" = "phase";
|
||||
"editor.cursorSmoothCaretAnimation" = "on";
|
||||
"editor.fontFamily" = builtins.concatStringsSep ", " hmConfig.theme.font.monospace.names;
|
||||
"editor.fontLigatures" = true;
|
||||
"editor.fontSize" = hmConfig.theme.font.size;
|
||||
"editor.formatOnPaste" = true;
|
||||
"editor.formatOnSave" = true;
|
||||
"editor.formatOnType" = true;
|
||||
"editor.indentSize" = "tabSize";
|
||||
"editor.inlineSuggest.enabled" = true;
|
||||
"editor.largeFileOptimizations" = false;
|
||||
"editor.linkedEditing" = true;
|
||||
"editor.renderFinalNewline" = "on";
|
||||
"editor.smoothScrolling" = true;
|
||||
"editor.stickyScroll.enabled" = true;
|
||||
"editor.suggestSelection" = "first";
|
||||
"editor.tabSize" = 2;
|
||||
"editor.unicodeHighlight.includeComments" = true;
|
||||
"editor.unicodeHighlight.nonBasicASCII" = true;
|
||||
"explorer.confirmDelete" = false;
|
||||
"explorer.confirmDragAndDrop" = false;
|
||||
"explorer.confirmPasteNative" = false;
|
||||
"extensions.autoCheckUpdates" = false;
|
||||
"extensions.autoUpdate" = false;
|
||||
"extensions.ignoreRecommendations" = true;
|
||||
"files.autoSave" = "afterDelay";
|
||||
"files.eol" = "\n";
|
||||
"files.insertFinalNewline" = true;
|
||||
"files.trimFinalNewlines" = true;
|
||||
"files.trimTrailingWhitespace" = true;
|
||||
"git.allowForcePush" = true;
|
||||
"git.alwaysSignOff" = true;
|
||||
"git.autofetch" = "all";
|
||||
"git.closeDiffOnOperation" = true;
|
||||
"git.confirmForcePush" = false;
|
||||
"git.confirmSync" = false;
|
||||
"git.enableCommitSigning" = true;
|
||||
"git.enableSmartCommit" = true;
|
||||
"git.ignoreRebaseWarning" = true;
|
||||
"git.openRepositoryInParentFolders" = "always";
|
||||
"git.path" = lib.meta.getExe pkgs.git;
|
||||
"mergeEditor.diffAlgorithm" = "advanced";
|
||||
"security.workspace.trust.enabled" = false;
|
||||
"telemetry.telemetryLevel" = "off";
|
||||
"terminal.external.linuxExec" = "kitty";
|
||||
"terminal.integrated.confirmOnExit" = "hasChildProcesses";
|
||||
"terminal.integrated.copyOnSelection" = true;
|
||||
"terminal.integrated.fontFamily" =
|
||||
builtins.concatStringsSep ", " hmConfig.theme.font.monospace.names;
|
||||
"terminal.integrated.fontSize" = hmConfig.theme.font.size;
|
||||
"update.mode" = "none";
|
||||
"window.autoDetectHighContrast" = false;
|
||||
"window.menuBarVisibility" = "toggle";
|
||||
"workbench.editor.historyBasedLanguageDetection" = true;
|
||||
"workbench.list.smoothScrolling" = true;
|
||||
"typescript.updateImportsOnFileMove.enabled" = "always";
|
||||
};
|
||||
};
|
||||
|
||||
home.file.".vscode/argv.json".source = (pkgs.formats.json { }).generate "argv.json" {
|
||||
password-store = "basic";
|
||||
};
|
||||
|
||||
imports = [
|
||||
./langs/c
|
||||
./langs/nix
|
||||
./langs/python
|
||||
./langs/svelte
|
||||
];
|
||||
|
||||
wayland.windowManager.hyprland.settings.bind = [ "$mod, c, exec, ${lib.meta.getExe pkgs.vscode}" ];
|
||||
};
|
||||
}
|
10
hosts/common/configs/user/gui/vscode/langs/c/default.nix
Normal file
10
hosts/common/configs/user/gui/vscode/langs/c/default.nix
Normal file
@@ -0,0 +1,10 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
programs.vscode.extensions =
|
||||
with pkgs;
|
||||
with vscode-extensions;
|
||||
[
|
||||
ms-vscode.cpptools
|
||||
ms-vscode.cmake-tools
|
||||
];
|
||||
}
|
19
hosts/common/configs/user/gui/vscode/langs/nix/default.nix
Normal file
19
hosts/common/configs/user/gui/vscode/langs/nix/default.nix
Normal file
@@ -0,0 +1,19 @@
|
||||
{ lib, pkgs, ... }:
|
||||
{
|
||||
programs.vscode = {
|
||||
userSettings = {
|
||||
"nix.enableLanguageServer" = true;
|
||||
"nix.serverPath" = lib.meta.getExe pkgs.nil;
|
||||
"nix.serverSettings" = {
|
||||
nil.formatting.command = [
|
||||
(lib.meta.getExe pkgs.nix)
|
||||
"fmt"
|
||||
"--"
|
||||
"--"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
extensions = with pkgs; with vscode-extensions; [ jnoortheen.nix-ide ];
|
||||
};
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
programs.vscode.extensions =
|
||||
with pkgs;
|
||||
with vscode-extensions;
|
||||
[
|
||||
ms-python.python
|
||||
ms-python.vscode-pylance
|
||||
ms-python.debugpy
|
||||
ms-python.pylint
|
||||
ms-toolsai.jupyter
|
||||
ms-toolsai.jupyter-renderers
|
||||
njpwerner.autodocstring
|
||||
];
|
||||
}
|
@@ -0,0 +1,15 @@
|
||||
{ pkgs, ... }:
|
||||
{
|
||||
programs.vscode = {
|
||||
userSettings = {
|
||||
"svelte.enable-ts-plugin" = true;
|
||||
};
|
||||
|
||||
extensions =
|
||||
with pkgs;
|
||||
with vscode-extensions;
|
||||
[
|
||||
svelte.svelte-vscode
|
||||
];
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user