From 60b2c05de7e6c2cb288f6fb1f0df76d6e4b872ea Mon Sep 17 00:00:00 2001 From: Elias Almqvist Date: Thu, 25 Jul 2024 17:03:24 -0700 Subject: [PATCH] yabai + skhd services --- nix-darwin/home.nix | 33 +++++---------------------------- nix-darwin/modules/skhd.nix | 35 +++++++++++++++++++++++++++++++++++ nix-darwin/modules/yabai.nix | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 75 insertions(+), 28 deletions(-) create mode 100644 nix-darwin/modules/skhd.nix create mode 100644 nix-darwin/modules/yabai.nix diff --git a/nix-darwin/home.nix b/nix-darwin/home.nix index f683a8b..6cd5002 100644 --- a/nix-darwin/home.nix +++ b/nix-darwin/home.nix @@ -37,6 +37,11 @@ }; }; + imports = [ + ./modules/yabai.nix + ./modules/skhd.nix + ]; + # The home.packages option allows you to install Nix packages into your # environment. home.packages = with pkgs; [ @@ -158,32 +163,4 @@ vimAlias = true; defaultEditor = true; }; - - # Services - - # yabai (wm) - services.yabai = { - enable = true; - package = pkgs.yabai; - config = { - layout = "bsp"; - auto_balance = "on"; - split_ratio = 0.50; - window_placement = "second_child"; - }; - # extraConfig = '' - # ''; - }; - - # skhd (keybinds etc.) - services.skhd = { - enable = true; - package = pkgs.skhd; - skhdConfig = '' - # Add your skhd keybindings here - # For example: - # alt - return : open -n /Applications/iTerm.app - # shift + alt - r : yabai -m space --rotate 90 - ''; - }; } diff --git a/nix-darwin/modules/skhd.nix b/nix-darwin/modules/skhd.nix new file mode 100644 index 0000000..e005a90 --- /dev/null +++ b/nix-darwin/modules/skhd.nix @@ -0,0 +1,35 @@ +{ config, pkgs, ... }: + +{ + # config + # service + home.file."Library/LaunchAgents/org.nixos.skhd.plist" = { + text = '' + + + + + Label + org.nixos.skhd + ProgramArguments + + ${pkgs.skhd}/bin/skhd + + EnvironmentVariables + + PATH + ${pkgs.skhd}/bin:${pkgs.bash}/bin:/usr/bin:/bin:/usr/sbin:/sbin + + RunAtLoad + + KeepAlive + + StandardOutPath + ${config.home.homeDirectory}/.skhd.out.log + StandardErrorPath + ${config.home.homeDirectory}/.skhd.err.log + + + ''; + }; +} diff --git a/nix-darwin/modules/yabai.nix b/nix-darwin/modules/yabai.nix new file mode 100644 index 0000000..f9b5c81 --- /dev/null +++ b/nix-darwin/modules/yabai.nix @@ -0,0 +1,35 @@ +{ config, pkgs, ... }: + +{ + # config + # service + home.file."Library/LaunchAgents/org.nixos.yabai.plist" = { + text = '' + + + + + Label + org.nixos.yabai + ProgramArguments + + ${pkgs.yabai}/bin/yabai + + EnvironmentVariables + + PATH + ${pkgs.yabai}/bin:${pkgs.bash}/bin:/usr/bin:/bin:/usr/sbin:/sbin + + RunAtLoad + + KeepAlive + + StandardOutPath + ${config.home.homeDirectory}/.yabai.out.log + StandardErrorPath + ${config.home.homeDirectory}/.yabai.err.log + + + ''; + }; +}