mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 03:29:45 +01:00
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
This commit is contained in:
parent
8bb5d53c58
commit
03f8e0b3b3
8 changed files with 102 additions and 0 deletions
|
@ -1748,6 +1748,18 @@ in {
|
|||
add `-w` to your assignment of `services.swayidle.extraArgs`.
|
||||
'';
|
||||
}
|
||||
|
||||
{
|
||||
time = "2024-10-09T06:16:23+00:00";
|
||||
condition = hostPlatform.isLinux;
|
||||
message = ''
|
||||
A new module is available: 'services.snixembed'.
|
||||
|
||||
snixembed proxies StatusNotifierItems as XEmbedded systemtray-spec
|
||||
icons. This is useful for some tools in some environments, e.g., Safe
|
||||
Eyes in i3, lxde or mate.
|
||||
'';
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -361,6 +361,7 @@ let
|
|||
./services/screen-locker.nix
|
||||
./services/sctd.nix
|
||||
./services/signaturepdf.nix
|
||||
./services/snixembed.nix
|
||||
./services/spotifyd.nix
|
||||
./services/ssh-agent.nix
|
||||
./services/stalonetray.nix
|
||||
|
|
50
modules/services/snixembed.nix
Normal file
50
modules/services/snixembed.nix
Normal file
|
@ -0,0 +1,50 @@
|
|||
{ 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;
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
|
@ -270,6 +270,7 @@ in import nmtSrc {
|
|||
./modules/services/remmina
|
||||
./modules/services/screen-locker
|
||||
./modules/services/signaturepdf
|
||||
./modules/services/snixembed
|
||||
./modules/services/swayidle
|
||||
./modules/services/swaync
|
||||
./modules/services/swayosd
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
[Desktop Entry]
|
||||
Exec=@xdg-utils@/bin/xdg-open http://localhost:9494
|
||||
Icon=/snixembed/share/snixembed/public/favicon.ico
|
||||
Name=Snixembed
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Version=1.4
|
16
tests/modules/services/snixembed/basic-configuration.nix
Normal file
16
tests/modules/services/snixembed/basic-configuration.nix
Normal file
|
@ -0,0 +1,16 @@
|
|||
{ ... }:
|
||||
|
||||
{
|
||||
services.snixembed = {
|
||||
enable = true;
|
||||
beforeUnits = [ "safeeyes.service" ];
|
||||
};
|
||||
|
||||
test.stubs = { snixembed = { outPath = "/snixembed"; }; };
|
||||
|
||||
nmt.script = ''
|
||||
assertFileContent \
|
||||
home-files/.config/systemd/user/snixembed.service \
|
||||
${./basic-configuration.service}
|
||||
'';
|
||||
}
|
14
tests/modules/services/snixembed/basic-configuration.service
Normal file
14
tests/modules/services/snixembed/basic-configuration.service
Normal file
|
@ -0,0 +1,14 @@
|
|||
[Install]
|
||||
WantedBy=graphical-session.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/snixembed/bin/dummy
|
||||
Restart=on-failure
|
||||
RestartSec=3
|
||||
|
||||
[Unit]
|
||||
Before=safeeyes.service
|
||||
Description=snixembed
|
||||
PartOf=graphical-session.target
|
||||
StartLimitBurst=10
|
||||
StartLimitIntervalSec=100
|
1
tests/modules/services/snixembed/default.nix
Normal file
1
tests/modules/services/snixembed/default.nix
Normal file
|
@ -0,0 +1 @@
|
|||
{ snixembed-basic-configuration = ./basic-configuration.nix; }
|
Loading…
Reference in a new issue