1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 11:36:05 +01:00
home-manager/modules/services/blueman-applet.nix
Austin Horstman 2c4ef7d717 blueman-applet: fix typo in systemdTargets
copy pasta error

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
2025-08-26 17:23:34 -05:00

65 lines
1.7 KiB
Nix

{
config,
lib,
pkgs,
...
}:
let
cfg = config.services.blueman-applet;
in
{
options = {
services.blueman-applet = {
enable = lib.mkEnableOption "" // {
description = ''
Whether to enable the Blueman applet.
Note that for the applet to work, the `blueman` service should
be enabled system-wide. You can enable it in the system
configuration using
```nix
services.blueman.enable = true;
```
'';
};
package = lib.mkPackageOption pkgs "blueman" { };
systemdTargets = lib.mkOption {
type = with lib.types; listOf str;
default = [ "graphical-session.target" ];
example = [ "sway-session.target" ];
description = ''
The systemd targets that will automatically start the blueman applet service.
When setting this value to `["sway-session.target"]`,
make sure to also enable {option}`wayland.windowManager.sway.systemd.enable`,
otherwise the service may never be started.
'';
};
};
};
config = lib.mkIf config.services.blueman-applet.enable {
assertions = [
(lib.hm.assertions.assertPlatform "services.blueman-applet" pkgs lib.platforms.linux)
];
systemd.user.services.blueman-applet = {
Unit = {
Description = "Blueman applet";
Requires = [ "tray.target" ];
After = cfg.systemdTargets ++ [ "tray.target" ];
PartOf = cfg.systemdTargets;
};
Install = {
WantedBy = cfg.systemdTargets;
};
Service = {
ExecStart = "${lib.getExe' cfg.package "blueman-applet"}";
};
};
};
}