diff options
author | Jan Tojnar <jtojnar@gmail.com> | 2021-02-05 18:05:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-05 18:05:39 +0100 |
commit | 493bbc968b89c942d34d2c46fe12e9ac1c77764e (patch) | |
tree | bbda222daa81c7ea963b669562fc0b27b1d095b4 /nixos/modules | |
parent | c25f19bd15c6d7ddbb26aa43a53f8c57b1d0c4c9 (diff) | |
parent | f5f9a069d9d95e7f1b2f5f2aea84a1d9b9411e52 (diff) |
Merge pull request #95337 from pasqui23/switchctl
Diffstat (limited to 'nixos/modules')
-rw-r--r-- | nixos/modules/hardware/video/switcheroo-control.nix | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/nixos/modules/hardware/video/switcheroo-control.nix b/nixos/modules/hardware/video/switcheroo-control.nix new file mode 100644 index 0000000000000..199adb2ad8f52 --- /dev/null +++ b/nixos/modules/hardware/video/switcheroo-control.nix @@ -0,0 +1,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" ]; + }; +} |