2023-04-17 10:44:54 +02:00
|
|
|
{ lib, pkgs, config, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
cfg = config.reo101.yabai;
|
|
|
|
in
|
|
|
|
{
|
|
|
|
imports = [
|
|
|
|
];
|
|
|
|
|
|
|
|
options = {
|
|
|
|
reo101.yabai = {
|
|
|
|
enable = mkEnableOption "reo101 yabai config";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2024-06-03 18:06:22 +02:00
|
|
|
config = mkIf cfg.enable (
|
|
|
|
let
|
|
|
|
borders = pkgs.callPackage ./borders { };
|
|
|
|
setbg = pkgs.callPackage ./setbg {
|
2024-01-21 21:09:56 +01:00
|
|
|
yabai = config.services.yabai.package;
|
2023-04-17 10:44:54 +02:00
|
|
|
};
|
2024-06-03 18:06:22 +02:00
|
|
|
in
|
|
|
|
{
|
|
|
|
environment.systemPackages = [
|
|
|
|
borders
|
|
|
|
setbg
|
|
|
|
];
|
|
|
|
|
|
|
|
services = {
|
|
|
|
yabai = {
|
|
|
|
enable = true;
|
|
|
|
package = pkgs.yabai;
|
|
|
|
enableScriptingAddition = true;
|
|
|
|
extraConfig = /* bash */ ''
|
|
|
|
${builtins.readFile ./yabairc}
|
|
|
|
|
|
|
|
# Load JankyBorders
|
2024-09-08 15:45:11 +02:00
|
|
|
${borders}/bin/borders active_color=0xffe1e3e4 inactive_color=0xff494d64 style=squared width=5.0 &
|
2024-06-03 18:06:22 +02:00
|
|
|
'';
|
|
|
|
};
|
2023-04-17 10:44:54 +02:00
|
|
|
|
2024-06-03 18:06:22 +02:00
|
|
|
skhd = {
|
|
|
|
enable = true;
|
|
|
|
package = pkgs.skhd;
|
2024-09-08 15:45:11 +02:00
|
|
|
skhdConfig = builtins.readFile ./skhdrc;
|
2024-06-03 18:06:22 +02:00
|
|
|
};
|
|
|
|
|
2024-09-08 15:45:11 +02:00
|
|
|
# sketchybar = {
|
|
|
|
# enable = true;
|
|
|
|
# package = pkgs.sketchybar;
|
|
|
|
# extraPackages = with pkgs; [
|
|
|
|
# jq
|
|
|
|
# ];
|
|
|
|
# config = import (lib.getExe (pkgs.callPackage ./sketchybar { }));
|
|
|
|
# };
|
|
|
|
};
|
|
|
|
|
|
|
|
# TODO: make builtin module work with scripts
|
|
|
|
launchd.user.agents.sketchybar = let
|
|
|
|
cfg = rec {
|
2024-06-03 18:06:22 +02:00
|
|
|
package = pkgs.sketchybar;
|
|
|
|
extraPackages = with pkgs; [
|
|
|
|
jq
|
|
|
|
];
|
2024-09-08 15:45:11 +02:00
|
|
|
configFile = lib.getExe (pkgs.callPackage ./sketchybar { sketchybar = package; });
|
2024-06-03 18:06:22 +02:00
|
|
|
};
|
2024-09-08 15:45:11 +02:00
|
|
|
in {
|
|
|
|
path = [ cfg.package ] ++ cfg.extraPackages ++ [ config.environment.systemPath ];
|
|
|
|
serviceConfig.ProgramArguments =
|
|
|
|
[
|
|
|
|
"${lib.getExe cfg.package}"
|
|
|
|
] ++ optionals (cfg.configFile != null) [
|
|
|
|
"--config"
|
|
|
|
"${cfg.configFile}"
|
|
|
|
];
|
|
|
|
serviceConfig.KeepAlive = true;
|
|
|
|
serviceConfig.RunAtLoad = true;
|
2023-04-17 10:44:54 +02:00
|
|
|
};
|
|
|
|
|
2024-06-03 18:06:22 +02:00
|
|
|
# For sketchybar
|
|
|
|
homebrew = {
|
|
|
|
taps = [
|
|
|
|
"shaunsingh/SFMono-Nerd-Font-Ligaturized"
|
|
|
|
];
|
|
|
|
casks = [
|
|
|
|
"font-sf-mono-nerd-font-ligaturized"
|
2023-07-29 16:45:58 +02:00
|
|
|
];
|
|
|
|
};
|
2024-06-03 18:06:22 +02:00
|
|
|
});
|
2023-04-17 10:44:54 +02:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
maintainers = with lib.maintainers; [ reo101 ];
|
|
|
|
};
|
|
|
|
}
|