dotfiles/home/apps/sketchybar.nix

45 lines
1.1 KiB
Nix
Raw Normal View History

{
2023-02-10 07:46:37 +01:00
config,
2023-02-24 22:02:18 +01:00
flakePath,
2023-02-10 07:46:37 +01:00
lib,
2023-02-24 22:02:18 +01:00
pkgs,
2023-02-10 07:46:37 +01:00
...
2023-02-24 22:02:18 +01:00
}: let
inherit (pkgs.stdenv.hostPlatform) isDarwin;
sketchybarPkg = pkgs.unstable.sketchybar;
in {
home = lib.mkIf isDarwin {
2023-02-24 22:02:18 +01:00
packages = [sketchybarPkg];
};
launchd = lib.mkIf isDarwin {
agents.sketchybar = {
enable = true;
config = {
2023-02-24 22:02:18 +01:00
ProgramArguments = ["${lib.getExe sketchybarPkg}"];
KeepAlive = true;
RunAtLoad = true;
ProcessType = "Interactive";
Nice = -20;
2023-02-24 22:02:18 +01:00
StandardErrorPath = "${config.xdg.cacheHome}/sketchybar.log";
StandardOutPath = "${config.xdg.cacheHome}/sketchybar.log";
EnvironmentVariables = {
LANG = "en_US.UTF-8";
PATH = "${lib.makeBinPath [
sketchybarPkg
pkgs.bash
pkgs.bc
pkgs.coreutils
pkgs.unstable.yabai
]}:/usr/bin";
};
};
};
};
xdg.configFile = lib.mkIf isDarwin {
"sketchybar" = {
2023-02-24 22:02:18 +01:00
source = config.lib.file.mkOutOfStoreSymlink "${flakePath}/home/apps/sketchybar";
recursive = true;
};
};
}