1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 11:36:05 +01:00

dbus: Create with pacakges options (#7064)

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.
This commit is contained in:
Rosario Pulella 2025-05-15 13:59:12 -04:00 committed by GitHub
parent 954615c510
commit ad1e8bb782
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 62 additions and 0 deletions

36
modules/dbus.nix Normal file
View file

@ -0,0 +1,36 @@
{
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";
};
};
};
}