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, ... }:
let
inherit (lib) mkEnableOption mkIf;
cfg = config.systemModules.services.dbus;
inherit (lib) mkIf;
inherit (lib.lists) any elem;
hasFunction = f: elem f config.systemModules.host.function;
in
{
options.systemModules.services.dbus.enable = mkEnableOption "Enable dbus system module";
config = mkIf cfg.enable {
config = mkIf (any hasFunction ["workstation" "gaming"]) {
services.dbus = {
enable = true;
packages = with pkgs; [ dconf gcr udisks2 ];