1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00
home-manager/tests/modules/dbus/packages.nix
Rosario Pulella ad1e8bb782
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.
2025-05-15 12:59:12 -05:00

21 lines
496 B
Nix

{ pkgs, config, ... }:
let
inherit (config.lib.test) mkStubPackage;
in
{
dbus.packages = [
(mkStubPackage {
name = "test";
buildScript = ''
mkdir -p $out/share/dbus-1/services
printf '%s' test > $out/share/dbus-1/services/test.service
'';
})
];
nmt.script = ''
serviceFile=home-files/.local/share/dbus-1/services/test.service
assertFileExists $serviceFile
assertFileContent $serviceFile "${pkgs.writeText "expected" "test"}"
'';
}