diff --git a/hosts/nixos/thinkpad/home.nix b/hosts/nixos/thinkpad/home.nix index a2aab8b..54def19 100644 --- a/hosts/nixos/thinkpad/home.nix +++ b/hosts/nixos/thinkpad/home.nix @@ -15,6 +15,7 @@ ../../../modules/papis.nix ../../../modules/libreoffice.nix ../../../modules/schedule.nix + ../../../modules/cursor.nix ]; # Enable Ghostty terminal with OSC-52 clipboard support @@ -31,6 +32,9 @@ package = pkgs.firefox; }; + # Enable Cursor editor + programs.cursor.package = pkgs.code-cursor; + # ThinkPad-specific applications home.packages = with pkgs; [ obsidian diff --git a/modules/cursor.nix b/modules/cursor.nix index a633227..34786f4 100644 --- a/modules/cursor.nix +++ b/modules/cursor.nix @@ -1,6 +1,10 @@ { config, pkgs, lib, ... }: +with lib; + let + cfg = config.programs.cursor; + configDir = if pkgs.stdenv.isDarwin then "Library/Application Support/Cursor/User" else ".config/Cursor/User"; @@ -48,7 +52,18 @@ let in { + options.programs.cursor = { + package = mkOption { + type = types.nullOr types.package; + default = null; + example = "pkgs.code-cursor"; + description = "Cursor package to use. Set to null on Darwin to use Homebrew-installed Cursor, or pkgs.code-cursor on NixOS."; + }; + }; + config = { + home.packages = mkIf (cfg.package != null) [ cfg.package ]; + home.file."${configDir}/settings.json" = { text = builtins.toJSON ideSettings; }; diff --git a/modules/gnome/home.nix b/modules/gnome/home.nix index 3a7c213..190aecd 100644 --- a/modules/gnome/home.nix +++ b/modules/gnome/home.nix @@ -52,6 +52,7 @@ in favorite-apps = [ "thunar.desktop" "com.mitchellh.ghostty.desktop" + "cursor.desktop" "firefox.desktop" "obsidian.desktop" "org.keepassxc.KeePassXC.desktop"