mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 00:43:20 +00:00
Merge pull request #291464 from Gerg-L/switcheroo2
nixos/switcherooControl: add package option
This commit is contained in:
commit
9798dc0a48
@ -1,18 +1,19 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
pkg = [ pkgs.switcheroo-control ];
|
||||
cfg = config.services.switcherooControl;
|
||||
in {
|
||||
options.services.switcherooControl = {
|
||||
enable = mkEnableOption (lib.mdDoc "switcheroo-control, a D-Bus service to check the availability of dual-GPU");
|
||||
enable = lib.mkEnableOption "switcheroo-control, a D-Bus service to check the availability of dual-GPU";
|
||||
package = lib.mkPackageOption pkgs "switcheroo-control" { };
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
services.dbus.packages = pkg;
|
||||
environment.systemPackages = pkg;
|
||||
systemd.packages = pkg;
|
||||
systemd.targets.multi-user.wants = [ "switcheroo-control.service" ];
|
||||
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" ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user