dbus: manage it ourselves instead of having systemd do it

This commit is contained in:
Colin 2024-05-29 11:30:29 +00:00
parent 770fc2e574
commit c570b7bf5d
4 changed files with 31 additions and 0 deletions

View File

@ -60,6 +60,8 @@ in
"useradd"
"userdel"
"usermod"
# from <repo:nixos/nixpkgs:nixos/modules/system/boot/systemd/user.nix>
"systemd-user" #< N.B.: this causes the `systemd --user` service manager to not be started!
])) services;
in lib.mapAttrs (_serviceName: service: service // {
# replace references with the old pam_unix, which calls into /run/wrappers/bin/unix_chkpwd,

View File

@ -254,6 +254,7 @@ in
# "abaddon" # discord client
"alacritty" # terminal emulator
"calls" # gnome calls (dialer/handler)
"dbus"
"dconf" # required by many packages, but not well-documented :(
# "delfin" # Jellyfin client
"dialect" # language translation

View File

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

View File

@ -24,6 +24,7 @@
./cozy.nix
./cups.nix
./curlftpfs.nix
./dbus.nix
./dconf.nix
./deadd-notification-center
./dialect.nix