mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-31 04:04:45 +00:00
Merge c77b5db4a0
into ebb88c3428
This commit is contained in:
commit
20ec8f5a73
1 changed files with 42 additions and 9 deletions
|
@ -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"
|
||||
];
|
||||
|
@ -43,6 +54,20 @@ in
|
|||
and [example](https://github.com/FelixKratz/SketchyBar/blob/master/sketchybarrc).
|
||||
'';
|
||||
};
|
||||
|
||||
errorLogFile = mkOption {
|
||||
type = types.nullOr types.path;
|
||||
default = "/tmp/sketchybar.err.log";
|
||||
example = "/Users/khaneliman/Library/Logs/sketchybar.log";
|
||||
description = "Absolute path to log all stderr output.";
|
||||
};
|
||||
|
||||
outLogFile = mkOption {
|
||||
type = types.nullOr types.path;
|
||||
default = "/tmp/sketchybar.out.log";
|
||||
example = "/Users/khaneliman/Library/Logs/sketchybar.log";
|
||||
description = "Absolute path to log all stdout output.";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
|
@ -50,10 +75,18 @@ 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;
|
||||
StandardErrorPath = cfg.errorLogFile;
|
||||
StandardOutPath = cfg.outLogFile;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue