mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-15 21:57:02 +03:00
nixos/switcheroo-control: added nixos option
node/switcheroo-control: better formatting
This commit is contained in:
parent
2d0ccc0ec0
commit
f5f9a069d9
18
nixos/modules/hardware/video/switcheroo-control.nix
Normal file
18
nixos/modules/hardware/video/switcheroo-control.nix
Normal file
@ -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" ];
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user