add cursor to thinkpad

This commit is contained in:
Yan Lin 2025-12-02 23:55:12 +01:00
parent bd513a60c5
commit b5e8bfcf83
3 changed files with 20 additions and 0 deletions

View file

@ -15,6 +15,7 @@
../../../modules/papis.nix ../../../modules/papis.nix
../../../modules/libreoffice.nix ../../../modules/libreoffice.nix
../../../modules/schedule.nix ../../../modules/schedule.nix
../../../modules/cursor.nix
]; ];
# Enable Ghostty terminal with OSC-52 clipboard support # Enable Ghostty terminal with OSC-52 clipboard support
@ -31,6 +32,9 @@
package = pkgs.firefox; package = pkgs.firefox;
}; };
# Enable Cursor editor
programs.cursor.package = pkgs.code-cursor;
# ThinkPad-specific applications # ThinkPad-specific applications
home.packages = with pkgs; [ home.packages = with pkgs; [
obsidian obsidian

View file

@ -1,6 +1,10 @@
{ config, pkgs, lib, ... }: { config, pkgs, lib, ... }:
with lib;
let let
cfg = config.programs.cursor;
configDir = if pkgs.stdenv.isDarwin configDir = if pkgs.stdenv.isDarwin
then "Library/Application Support/Cursor/User" then "Library/Application Support/Cursor/User"
else ".config/Cursor/User"; else ".config/Cursor/User";
@ -48,7 +52,18 @@ let
in 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 = { config = {
home.packages = mkIf (cfg.package != null) [ cfg.package ];
home.file."${configDir}/settings.json" = { home.file."${configDir}/settings.json" = {
text = builtins.toJSON ideSettings; text = builtins.toJSON ideSettings;
}; };

View file

@ -52,6 +52,7 @@ in
favorite-apps = [ favorite-apps = [
"thunar.desktop" "thunar.desktop"
"com.mitchellh.ghostty.desktop" "com.mitchellh.ghostty.desktop"
"cursor.desktop"
"firefox.desktop" "firefox.desktop"
"obsidian.desktop" "obsidian.desktop"
"org.keepassxc.KeePassXC.desktop" "org.keepassxc.KeePassXC.desktop"