{ config, pkgs, lib, ... }: let configDir = if pkgs.stdenv.isDarwin then "Library/Application Support/Cursor/User" else ".config/Cursor/User"; cursorCmd = if pkgs.stdenv.isDarwin then "/opt/homebrew/bin/cursor" else "cursor"; ideSettings = { "editor.fontFamily" = "'JetBrainsMono Nerd Font Mono', 'Noto Sans CJK SC', 'Noto Sans CJK TC', monospace"; "editor.fontSize" = 14; "editor.tabSize" = 2; "editor.insertSpaces" = true; "editor.wordWrap" = "off"; "editor.lineNumbers" = "on"; "editor.autoIndent" = "advanced"; "workbench.colorTheme" = "Gruvbox Dark Hard"; "git.openRepositoryInParentFolders" = "never"; "vim.leader" = ""; "vim.useSystemClipboard" = true; "vim.normalModeKeyBindingsNonRecursive" = [ { before = ["" "w"]; commands = ["workbench.action.files.save"]; } { before = ["" "q"]; commands = ["workbench.action.closeActiveEditor"]; } { before = ["" "e"]; commands = ["workbench.action.toggleSidebarVisibility"]; } { before = [""]; commands = ["workbench.action.previousEditor"]; } { before = [""]; commands = ["workbench.action.nextEditor"]; } { before = ["" "x"]; commands = ["workbench.action.closeActiveEditor"]; } { before = ["" "X"]; commands = ["workbench.action.closeOtherEditors"]; } { before = ["" "t"]; commands = ["workbench.action.quickOpen"]; } { before = ["" "g"]; commands = ["workbench.action.findInFiles"]; } ]; }; cliConfig = {}; in { config = { home.file."${configDir}/settings.json" = { text = builtins.toJSON ideSettings; }; home.file.".cursor/cli-config.json" = { text = builtins.toJSON cliConfig; }; home.activation.installCursorExtensions = config.lib.dag.entryAfter ["writeBoundary"] '' if command -v ${cursorCmd} &> /dev/null; then run ${cursorCmd} --install-extension vscodevim.vim &> /dev/null || true run ${cursorCmd} --install-extension jdinhlife.gruvbox &> /dev/null || true run ${cursorCmd} --install-extension jnoortheen.nix-ide &> /dev/null || true run ${cursorCmd} --install-extension tomoki1207.pdf &> /dev/null || true fi ''; }; }