2025-01-20 22:35:40 -05:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.nmasur.presets.services.hammerspoon;
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
options.nmasur.presets.services.hammerspoon.enable =
|
|
|
|
lib.mkEnableOption "Hammerspoon macOS automation";
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
2025-01-29 21:12:48 -05:00
|
|
|
xdg.configFile."hammerspoon/init.lua".source = ./init.lua;
|
|
|
|
xdg.configFile."hammerspoon/Spoons/ControlEscape.spoon".source = ./Spoons/ControlEscape.spoon;
|
|
|
|
xdg.configFile."hammerspoon/Spoons/DismissAlerts.spoon".source = ./Spoons/DismissAlerts.spoon;
|
2025-01-20 22:35:40 -05:00
|
|
|
xdg.configFile."hammerspoon/Spoons/Launcher.spoon/init.lua".source = pkgs.substituteAll {
|
2025-01-29 21:12:48 -05:00
|
|
|
src = ./Spoons/Launcher.spoon/init.lua;
|
2025-01-20 22:35:40 -05:00
|
|
|
firefox = "${pkgs.firefox-bin}/Applications/Firefox.app";
|
|
|
|
discord = "${pkgs.discord}/Applications/Discord.app";
|
|
|
|
wezterm = "${pkgs.wezterm}/Applications/WezTerm.app";
|
|
|
|
obsidian = "${pkgs.obsidian}/Applications/Obsidian.app";
|
|
|
|
slack = "${pkgs.slack}/Applications/Slack.app";
|
|
|
|
};
|
2025-01-29 21:12:48 -05:00
|
|
|
xdg.configFile."hammerspoon/Spoons/MoveWindow.spoon".source = ./Spoons/MoveWindow.spoon;
|
2025-01-20 22:35:40 -05:00
|
|
|
|
|
|
|
home.activation.reloadHammerspoon =
|
|
|
|
config.home-manager.users.${config.user}.lib.dag.entryAfter [ "writeBoundary" ]
|
|
|
|
''
|
|
|
|
$DRY_RUN_CMD /Applications/Hammerspoon.app/Contents/Frameworks/hs/hs -c "hs.reload()"
|
|
|
|
$DRY_RUN_CMD sleep 1
|
|
|
|
$DRY_RUN_CMD /Applications/Hammerspoon.app/Contents/Frameworks/hs/hs -c "hs.console.clearConsole()"
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|