summary refs log blame commit diff
path: root/nixos/modules/hardware/video/switcheroo-control.nix
blob: 199adb2ad8f52a5013dc7662e1a4b91a812d8b6d (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

















                                                                                                        
{ config, pkgs, lib, ... }:

with lib;
let
  pkg = [ pkgs.switcheroo-control ];
  cfg = config.services.switcherooControl;
in {
  options.services.switcherooControl = {
    enable = mkEnableOption "switcheroo-control, a D-Bus service to check the availability of dual-GPU";
  };

  config = mkIf cfg.enable {
    services.dbus.packages = pkg;
    environment.systemPackages = pkg;
    systemd.packages = pkg;
    systemd.targets.multi-user.wants = [ "switcheroo-control.service" ];
  };
}