From 0b71023f810c2c0c383044e01bcde770a2ffa918 Mon Sep 17 00:00:00 2001 From: reo101 Date: Mon, 3 Jun 2024 19:06:22 +0300 Subject: [PATCH] feat(yabai)!: add `JankyBorders` --- modules/nix-darwin/yabai/borders/default.nix | 19 ++--- modules/nix-darwin/yabai/default.nix | 81 +++++++++++--------- 2 files changed, 54 insertions(+), 46 deletions(-) diff --git a/modules/nix-darwin/yabai/borders/default.nix b/modules/nix-darwin/yabai/borders/default.nix index 908fdc5..efea028 100755 --- a/modules/nix-darwin/yabai/borders/default.nix +++ b/modules/nix-darwin/yabai/borders/default.nix @@ -1,26 +1,23 @@ { lib, fetchFromGitHub, darwin, ... }: -# TODO: fix clang issue (works with native `/usr/bin/clang`) -# -# > Undefined symbols for architecture arm64: -# > "_SLSWindowManagementBridgeSetDelegate", referenced from: -# > _main in main.o -# > ld: symbol(s) not found for architecture arm64 - darwin.apple_sdk.stdenv.mkDerivation rec { pname = "JankyBorders"; version = "dev"; src = fetchFromGitHub { owner = "FelixKratz"; - repo = "JankyBorders"; - rev = "6bc201813bc163c6f5a20d5fa744f7b0d1f31773"; - sha256 = "sha256-b4+aJkP1yqz8x5EUDDVQmqrmLus+Y69RViAeaLvfGXE="; + repo = pname; + rev = "e2af0248fa40ead3f17f1d16c6288b8ddfd9f505"; + hash = "sha256-rYA6b6d3c4pJVUIV77z/JMcgKbZ+4qZdxkI21LwZcG4="; }; buildInputs = with darwin.apple_sdk.frameworks; [ AppKit SkyLight - darwin.apple_sdk.Libsystem ]; + + installPhase = '' + mkdir -p $out/bin + cp ./bin/borders $out/bin/ + ''; } diff --git a/modules/nix-darwin/yabai/default.nix b/modules/nix-darwin/yabai/default.nix index db6ada8..4671fb8 100644 --- a/modules/nix-darwin/yabai/default.nix +++ b/modules/nix-darwin/yabai/default.nix @@ -14,47 +14,58 @@ in }; }; - config = mkIf cfg.enable { - environment.systemPackages = [ - (pkgs.callPackage ./setbg { + config = mkIf cfg.enable ( + let + borders = pkgs.callPackage ./borders { }; + setbg = pkgs.callPackage ./setbg { yabai = config.services.yabai.package; - }) - ]; + }; + in + { + environment.systemPackages = [ + borders + setbg + ]; - services = { - yabai = { - enable = true; - package = pkgs.yabai; - enableScriptingAddition = true; - extraConfig = (builtins.readFile ./yabairc); + services = { + yabai = { + enable = true; + package = pkgs.yabai; + enableScriptingAddition = true; + extraConfig = /* bash */ '' + ${builtins.readFile ./yabairc} + + # Load JankyBorders + ${borders}/bin/borders active_color=0xffe1e3e4 inactive_color=0xff494d64 width=5.0 & + ''; + }; + + skhd = { + enable = true; + package = pkgs.skhd; + skhdConfig = (builtins.readFile ./skhdrc); + }; + + sketchybar = { + enable = true; + package = pkgs.sketchybar; + extraPackages = with pkgs; [ + jq + ]; + config = import ./sketchybar pkgs; + }; }; - skhd = { - enable = true; - package = pkgs.skhd; - skhdConfig = (builtins.readFile ./skhdrc); - }; - - sketchybar = { - enable = true; - package = pkgs.sketchybar; - extraPackages = with pkgs; [ - jq + # For sketchybar + homebrew = { + taps = [ + "shaunsingh/SFMono-Nerd-Font-Ligaturized" + ]; + casks = [ + "font-sf-mono-nerd-font-ligaturized" ]; - config = import ./sketchybar pkgs; }; - }; - - # For sketchybar - homebrew = { - taps = [ - "shaunsingh/SFMono-Nerd-Font-Ligaturized" - ]; - casks = [ - "font-sf-mono-nerd-font-ligaturized" - ]; - }; - }; + }); meta = { maintainers = with lib.maintainers; [ reo101 ];