1 { config, lib, pkgs, ... }:
4 cfg = config.services.supergfxd;
5 json = pkgs.formats.json { };
10 enable = lib.mkEnableOption "the supergfxd service";
12 settings = lib.mkOption {
13 type = lib.types.nullOr json.type;
16 The content of /etc/supergfxd.conf.
17 See https://gitlab.com/asus-linux/supergfxctl/#config-options-etcsupergfxdconf.
23 config = lib.mkIf cfg.enable {
24 environment.systemPackages = [ pkgs.supergfxctl ];
26 environment.etc."supergfxd.conf" = lib.mkIf (cfg.settings != null) {
27 source = json.generate "supergfxd.conf" cfg.settings;
31 services.dbus.enable = true;
33 systemd.packages = [ pkgs.supergfxctl ];
34 systemd.services.supergfxd.wantedBy = [ "multi-user.target" ];
35 systemd.services.supergfxd.path = [ pkgs.kmod pkgs.pciutils ];
37 services.dbus.packages = [ pkgs.supergfxctl ];
38 services.udev.packages = [ pkgs.supergfxctl ];
41 meta.maintainers = pkgs.supergfxctl.meta.maintainers;