0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-21 01:20:34 +03:00
nixpkgs/nixos/modules/hardware/video/switcheroo-control.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

26 lines
570 B
Nix
Raw Normal View History

{
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" ];
};
};
}