depot/third_party/nixpkgs/nixos/modules/hardware/video/switcheroo-control.nix
Default email c7cb07f092 Project import generated by Copybara.
GitOrigin-RevId: 1536926ef5621b09bba54035ae2bb6d806d72ac8
2024-02-29 21:09:43 +01:00

19 lines
562 B
Nix

{ config, pkgs, lib, ... }:
let
cfg = config.services.switcherooControl;
in {
options.services.switcherooControl = {
enable = lib.mkEnableOption "switcheroo-control, a D-Bus service to check the availability of dual-GPU";
package = lib.mkPackageOption pkgs "switcheroo-control" { };
};
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" ];
};
};
}