1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-12-13 04:21:08 +01:00
home-manager/modules/services/snixembed.nix
fidgetingbits 13cc1efd78 snixembed: add waybar incompatbility warning
If snixembed is enabled and you try to use the waybar tray the two tools
conflict with eachother and often waybar's tray will not show any icons.
This adds a warning about it, as the problem can be difficult to
diagnose.
2025-12-09 21:27:32 -06:00

59 lines
1.4 KiB
Nix

{
config,
lib,
pkgs,
...
}:
let
cfg = config.services.snixembed;
waybarCfg = config.programs.waybar;
in
{
meta.maintainers = [ lib.maintainers.DamienCassou ];
options = {
services.snixembed = {
enable = lib.mkEnableOption "snixembed: proxy StatusNotifierItems as XEmbedded systemtray-spec icons";
package = lib.mkPackageOption pkgs "snixembed" { };
beforeUnits = lib.mkOption {
type = with lib.types; listOf str;
default = [ ];
example = [ "safeeyes.service" ];
description = ''
List of other units that should be started after snixembed.
'';
};
};
};
config = lib.mkIf cfg.enable {
assertions = [
(lib.hm.assertions.assertPlatform "services.snixembed" pkgs lib.platforms.linux)
];
warnings = lib.optional waybarCfg.enable ''
snixembed and waybar should not be enabled at the same time.
You may experience inconsistent tray behavior as a result.
'';
systemd.user.services.snixembed = {
Install.WantedBy = [ "graphical-session.target" ];
Unit = {
Description = "snixembed";
PartOf = [ "graphical-session.target" ];
StartLimitIntervalSec = 100;
StartLimitBurst = 10;
Before = cfg.beforeUnits;
};
Service = {
ExecStart = lib.getExe pkgs.snixembed;
Restart = "on-failure";
RestartSec = 3;
};
};
};
}