2020-08-13 14:46:24 +01:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
pkg = [ pkgs.switcheroo-control ];
|
|
|
|
cfg = config.services.switcherooControl;
|
|
|
|
in {
|
|
|
|
options.services.switcherooControl = {
|
2022-08-28 20:18:44 +01:00
|
|
|
enable = mkEnableOption (lib.mdDoc "switcheroo-control, a D-Bus service to check the availability of dual-GPU");
|
2020-08-13 14:46:24 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
services.dbus.packages = pkg;
|
|
|
|
environment.systemPackages = pkg;
|
|
|
|
systemd.packages = pkg;
|
|
|
|
systemd.targets.multi-user.wants = [ "switcheroo-control.service" ];
|
|
|
|
};
|
|
|
|
}
|