1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-30 06:59:45 +01:00
home-manager/modules/services/snixembed.nix
Damien Cassou 03f8e0b3b3
snixembed: add module
This is used by SafeEyes (another home-manager) module to show a
systemtray icon. See https://git.sr.ht/~steef/snixembed.

Fixes #5728
2024-10-11 00:14:36 +02:00

50 lines
1.2 KiB
Nix

{ config, lib, pkgs, ... }:
with lib;
let cfg = config.services.snixembed;
in {
meta.maintainers = [ maintainers.DamienCassou ];
options = {
services.snixembed = {
enable = mkEnableOption
"snixembed: proxy StatusNotifierItems as XEmbedded systemtray-spec icons";
package = mkPackageOption pkgs "snixembed" { };
beforeUnits = mkOption {
type = with types; listOf str;
default = [ ];
example = [ "safeeyes.service" ];
description = ''
List of other units that should be started after snixembed.
'';
};
};
};
config = mkIf cfg.enable {
assertions = [
(hm.assertions.assertPlatform "services.snixembed" pkgs platforms.linux)
];
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 = getExe pkgs.snixembed;
Restart = "on-failure";
RestartSec = 3;
};
};
};
}