nixos/switcherooControl: add package option
clean up
This commit is contained in:
parent
aa37fffc7c
commit
d70c353c16
1 changed files with 9 additions and 8 deletions
|
@ -1,18 +1,19 @@
|
||||||
{ config, pkgs, lib, ... }:
|
{ config, pkgs, lib, ... }:
|
||||||
|
|
||||||
with lib;
|
|
||||||
let
|
let
|
||||||
pkg = [ pkgs.switcheroo-control ];
|
|
||||||
cfg = config.services.switcherooControl;
|
cfg = config.services.switcherooControl;
|
||||||
in {
|
in {
|
||||||
options.services.switcherooControl = {
|
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 {
|
config = lib.mkIf cfg.enable {
|
||||||
services.dbus.packages = pkg;
|
services.dbus.packages = [ cfg.package ];
|
||||||
environment.systemPackages = pkg;
|
environment.systemPackages = [ cfg.package ];
|
||||||
systemd.packages = pkg;
|
systemd = {
|
||||||
systemd.targets.multi-user.wants = [ "switcheroo-control.service" ];
|
packages = [ cfg.package ];
|
||||||
|
targets.multi-user.wants = [ "switcheroo-control.service" ];
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue