at 23.11-pre 501 B view raw
1{ config, pkgs, lib, ... }: 2 3with lib; 4let 5 pkg = [ pkgs.switcheroo-control ]; 6 cfg = config.services.switcherooControl; 7in { 8 options.services.switcherooControl = { 9 enable = mkEnableOption (lib.mdDoc "switcheroo-control, a D-Bus service to check the availability of dual-GPU"); 10 }; 11 12 config = mkIf cfg.enable { 13 services.dbus.packages = pkg; 14 environment.systemPackages = pkg; 15 systemd.packages = pkg; 16 systemd.targets.multi-user.wants = [ "switcheroo-control.service" ]; 17 }; 18}