diff options
author | Pasquale <p3dimaria@hotmail.it> | 2020-08-13 15:46:24 +0200 |
---|---|---|
committer | Jan Tojnar <jtojnar@gmail.com> | 2021-02-05 17:39:44 +0100 |
commit | f5f9a069d9d95e7f1b2f5f2aea84a1d9b9411e52 (patch) | |
tree | 6f75cd5c41198a30db05e6cca6871da0c3f554db /nixos/modules | |
parent | 2d0ccc0ec0850299e9af72e1e34468552b5e48be (diff) |
nixos/switcheroo-control: added nixos option
node/switcheroo-control: better formatting
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" ]; + }; +} |