1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-31 04:04:45 +00:00

services/sketchybar: cleanup

This commit is contained in:
Austin Horstman 2024-12-17 22:32:32 -06:00
parent 62ba0a2242
commit 7d1e77fb76
No known key found for this signature in database

View file

@ -1,15 +1,26 @@
{ config, lib, pkgs, ... }:
{
config,
lib,
pkgs,
...
}:
let
inherit (lib) literalExpression maintainers mkEnableOption mkIf mkPackageOption mkOption optionals types;
inherit (lib)
literalExpression
maintainers
mkEnableOption
mkIf
mkPackageOption
mkOption
optionals
types
;
cfg = config.services.sketchybar;
configFile = pkgs.writeScript "sketchybarrc" cfg.config;
in
{
meta.maintainers = [
maintainers.azuwis or "azuwis"
];
@ -50,10 +61,16 @@ in
launchd.user.agents.sketchybar = {
path = [ cfg.package ] ++ cfg.extraPackages ++ [ config.environment.systemPath ];
serviceConfig.ProgramArguments = [ "${cfg.package}/bin/sketchybar" ]
++ optionals (cfg.config != "") [ "--config" "${configFile}" ];
serviceConfig.KeepAlive = true;
serviceConfig.RunAtLoad = true;
serviceConfig = {
ProgramArguments =
[ "${cfg.package}/bin/sketchybar" ]
++ optionals (cfg.config != "") [
"--config"
"${configFile}"
];
KeepAlive = true;
RunAtLoad = true;
};
};
};
}