refactor(systemModules:dbus): change to enable if valid function
This commit is contained in:
parent
c69b0d57e3
commit
033eed4fdc
1 changed files with 4 additions and 5 deletions
|
|
@ -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 ];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue