Skip to content

Commit

Permalink
services/sketchybar: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
khaneliman committed Jan 17, 2025
1 parent 09414c7 commit 0feb18f
Showing 1 changed file with 26 additions and 9 deletions.
35 changes: 26 additions & 9 deletions modules/services/sketchybar/default.nix
Original file line number Diff line number Diff line change
@@ -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"
];
Expand Down Expand Up @@ -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;
};
};
};
}

0 comments on commit 0feb18f

Please sign in to comment.