2021-02-05 17:12:51 +00:00
|
|
|
{ config, pkgs, lib, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.services.switcherooControl;
|
|
|
|
in {
|
|
|
|
options.services.switcherooControl = {
|
2024-02-29 20:09:43 +00:00
|
|
|
enable = lib.mkEnableOption "switcheroo-control, a D-Bus service to check the availability of dual-GPU";
|
|
|
|
package = lib.mkPackageOption pkgs "switcheroo-control" { };
|
2021-02-05 17:12:51 +00:00
|
|
|
};
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
config = lib.mkIf cfg.enable {
|
|
|
|
services.dbus.packages = [ cfg.package ];
|
|
|
|
environment.systemPackages = [ cfg.package ];
|
|
|
|
systemd = {
|
|
|
|
packages = [ cfg.package ];
|
|
|
|
targets.multi-user.wants = [ "switcheroo-control.service" ];
|
|
|
|
};
|
2021-02-05 17:12:51 +00:00
|
|
|
};
|
|
|
|
}
|