{ username ? throw "username argument is required", }: { config, lib, pkgs, ... }: let hmConfig = config.home-manager.users.${username}; in { environment.persistence = { "/persist".users.${username}.directories = [ "${hmConfig.xdg.relativeConfigHome}/Code" ]; # Bastard: https://github.com/microsoft/vscode/issues/3884 "/cache".users.${username}.directories = [ "${hmConfig.xdg.relativeConfigHome}/Code/Cache" "${hmConfig.xdg.relativeConfigHome}/Code/CachedConfigurations" "${hmConfig.xdg.relativeConfigHome}/Code/CachedData" "${hmConfig.xdg.relativeConfigHome}/Code/CachedExtensionVSIXs" "${hmConfig.xdg.relativeConfigHome}/Code/CachedExtensions" "${hmConfig.xdg.relativeConfigHome}/Code/CachedProfilesData" "${hmConfig.xdg.relativeConfigHome}/Code/Code Cache" "${hmConfig.xdg.relativeConfigHome}/Code/DawnCache" "${hmConfig.xdg.relativeConfigHome}/Code/GPUCache" "${hmConfig.xdg.relativeConfigHome}/Code/Service Worker/CacheStorage" "${hmConfig.xdg.relativeConfigHome}/Code/Service Worker/ScriptCache" ]; }; home-manager.users.${username} = { programs.vscode = { enable = true; mutableExtensionsDir = false; extensions = with pkgs.vscode-extensions; [ naumovs.color-highlight ]; 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; "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"; "open-in-browser.default" = "firefox"; "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; }; }; imports = [ ./langs/nix.nix ]; }; }