mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 11:36:05 +01:00
This adds a module for dbus with only one option, `packages`. The `dbus.packages` options allows users to specify packages to have their dbus service files (from `/share/dbus-1/services`) linked to the users dbus services directory (`$XDG_DATA_HOME/dbus-1/services/`), effectively enabling the services.
36 lines
820 B
Nix
36 lines
820 B
Nix
{
|
|
config,
|
|
pkgs,
|
|
lib,
|
|
...
|
|
}:
|
|
let
|
|
cfg = config.dbus;
|
|
in
|
|
{
|
|
meta.maintainers = [ lib.hm.maintainers.rosuavio ];
|
|
|
|
options.dbus = {
|
|
packages = lib.mkOption {
|
|
type = with lib.types; types.listOf types.package;
|
|
default = [ ];
|
|
description = ''
|
|
Packages whose D-Bus configuration files should be included in
|
|
the configuration of the D-Bus session-wide message bus. Specifically,
|
|
files in «pkg»/share/dbus-1/services will be included in the user's
|
|
$XDG_DATA_HOME/dbus-1/services directory.
|
|
'';
|
|
};
|
|
};
|
|
|
|
config = {
|
|
xdg.dataFile."dbus-1/services" = {
|
|
recursive = true;
|
|
source = pkgs.symlinkJoin {
|
|
name = "user-dbus-services";
|
|
paths = cfg.packages;
|
|
stripPrefix = "/share/dbus-1/services";
|
|
};
|
|
};
|
|
};
|
|
}
|