Skip to content

Commit

Permalink
feat: add Raycast configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
sudosubin committed Jan 1, 2025
1 parent 4dd77f2 commit c2f7dfb
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 1 deletion.
1 change: 1 addition & 0 deletions libraries/home-manager/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ in
./programs/jq
./programs/kube
./programs/lsd
./programs/raycast
./programs/yabai

# os systems
Expand Down
63 changes: 63 additions & 0 deletions libraries/home-manager/programs/raycast/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{ config, pkgs, lib, ... }:
with lib;

let
inherit (pkgs.stdenvNoCC.hostPlatform) isDarwin;
cfg = config.services.raycast;

in
{
options.services.raycast = {
enable = mkEnableOption "raycast";

package = mkPackageOption pkgs "raycast" { };

config = {
navigationCommandStyleIdentifierKey = mkOption {
type = types.str;
default = "macos";
description = "Navigation Bindings";
};

raycastGlobalHotkey = mkOption {
type = types.str;
default = "Option-49";
description = "Raycast Hotkey";
};

raycastPreferredWindowMode = mkOption {
type = types.str;
default = "default";
description = "Window Mode";
};
};
};

config = mkMerge [
{
assertions = [
{
assertion = cfg.enable -> isDarwin;
message = "Nix raycast only supports darwin.";
}
];
}

(mkIf cfg.enable {
home.packages = [ cfg.package ];

darwin.defaults."com.raycast.macos" = cfg.config;

launchd.agents.raycast = {
enable = true;
config = {
ProgramArguments = [ "${config.home.homeDirectory}/Applications/Home Manager Apps/${cfg.package.sourceRoot}/Contents/MacOS/Raycast" ];
KeepAlive = true;
ProcessType = "Interactive";
StandardOutPath = "${config.xdg.cacheHome}/raycast.log";
StandardErrorPath = "${config.xdg.cacheHome}/raycast.log";
};
};
})
];
}
1 change: 1 addition & 0 deletions libraries/nixpkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ in
"ijhttp"
"ngrok"
"orbstack"
"raycast"
"redisinsight"
"cleanshot"
"slack"
Expand Down
3 changes: 2 additions & 1 deletion modules/darwin/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@
sqlfluff

# Utility
cleanshot
deskpad
discord
nodePackages.localtunnel
redisinsight
ripgrep
cleanshot
unzip
];

Expand Down Expand Up @@ -71,6 +71,7 @@
../darwin/programs/desktop
../darwin/programs/hammerspoon
../darwin/programs/homerow
../darwin/programs/raycast
../darwin/programs/yabai
];

Expand Down
13 changes: 13 additions & 0 deletions modules/darwin/programs/raycast/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{ config, lib, pkgs, ... }:

{
services.raycast = {
enable = true;

config = {
navigationCommandStyleIdentifierKey = "vim";
raycastGlobalHotkey = "Command-49";
raycastPreferredWindowMode = "compact";
};
};
}
1 change: 1 addition & 0 deletions modules/darwin/programs/yabai/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
# Third-party
yabai -m rule --add app="^Homerow$" manage="off"
yabai -m rule --add app="^Raycast$" manage="off"
'';
};
}

0 comments on commit c2f7dfb

Please sign in to comment.