2021-02-05 17:12:51 +00:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
let
|
|
|
|
pkg = [ pkgs.switcheroo-control ];
|
|
|
|
cfg = config.services.switcherooControl;
|
|
|
|
in {
|
|
|
|
options.services.switcherooControl = {
|
2022-09-09 14:08:57 +00:00
|
|
|
enable = mkEnableOption (lib.mdDoc "switcheroo-control, a D-Bus service to check the availability of dual-GPU");
|
2021-02-05 17:12:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
config = mkIf cfg.enable {
|
|
|
|
services.dbus.packages = pkg;
|
|
|
|
environment.systemPackages = pkg;
|
|
|
|
systemd.packages = pkg;
|
|
|
|
systemd.targets.multi-user.wants = [ "switcheroo-control.service" ];
|
|
|
|
};
|
|
|
|
}
|