refactor(systemModules:dbus): change to enable if valid function

This commit is contained in:
ooks-io 2024-04-30 21:02:51 +12:00
parent c69b0d57e3
commit 033eed4fdc

View file

@ -1,14 +1,13 @@
{ lib, config, pkgs, ... }: { lib, config, pkgs, ... }:
let let
inherit (lib) mkEnableOption mkIf; inherit (lib) mkIf;
cfg = config.systemModules.services.dbus; inherit (lib.lists) any elem;
hasFunction = f: elem f config.systemModules.host.function;
in in
{ {
options.systemModules.services.dbus.enable = mkEnableOption "Enable dbus system module"; config = mkIf (any hasFunction ["workstation" "gaming"]) {
config = mkIf cfg.enable {
services.dbus = { services.dbus = {
enable = true; enable = true;
packages = with pkgs; [ dconf gcr udisks2 ]; packages = with pkgs; [ dconf gcr udisks2 ];