28 lines
839 B
Nix
28 lines
839 B
Nix
|
{ config, lib, ... }:
|
||
|
let
|
||
|
cfg = config.sane.programs.dissent;
|
||
|
in
|
||
|
{
|
||
|
sane.programs.dbus = {
|
||
|
configOption = with lib; mkOption {
|
||
|
default = {};
|
||
|
type = types.submodule {
|
||
|
options.autostart = mkOption {
|
||
|
type = types.bool;
|
||
|
default = true;
|
||
|
};
|
||
|
};
|
||
|
};
|
||
|
|
||
|
# normally systemd would create a dbus session for us, but if you configure it not to do that
|
||
|
# then we can create our own. not sure if there's a dependency ordering issue here: lots
|
||
|
# of things depend on dbus but i don't do anything special to guarantee this is initialized
|
||
|
# before them.
|
||
|
services.dbus = {
|
||
|
description = "dbus user session";
|
||
|
partOf = lib.mkIf cfg.config.autostart [ "default" ];
|
||
|
command = "dbus-daemon --session --nofork --address=unix:path=/run/user/$UID/bus";
|
||
|
};
|
||
|
};
|
||
|
}
|