9 cfg = config.services.asusd;
14 enable = lib.mkEnableOption "the asusd service for ASUS ROG laptops";
16 package = lib.mkPackageOption pkgs "asusctl" { };
18 enableUserService = lib.mkOption {
19 type = lib.types.bool;
22 Activate the asusd-user service.
26 animeConfig = lib.mkOption {
27 type = lib.types.nullOr lib.types.str;
30 The content of /etc/asusd/anime.ron.
31 See https://asus-linux.org/asusctl/#anime-control.
35 asusdConfig = lib.mkOption {
36 type = lib.types.nullOr lib.types.str;
39 The content of /etc/asusd/asusd.ron.
40 See https://asus-linux.org/asusctl/.
44 auraConfig = lib.mkOption {
45 type = lib.types.nullOr lib.types.str;
48 The content of /etc/asusd/aura.ron.
49 See https://asus-linux.org/asusctl/#led-keyboard-control.
53 profileConfig = lib.mkOption {
54 type = lib.types.nullOr lib.types.str;
57 The content of /etc/asusd/profile.ron.
58 See https://asus-linux.org/asusctl/#profiles.
62 fanCurvesConfig = lib.mkOption {
63 type = lib.types.nullOr lib.types.str;
66 The content of /etc/asusd/fan_curves.ron.
67 See https://asus-linux.org/asusctl/#fan-curves.
71 userLedModesConfig = lib.mkOption {
72 type = lib.types.nullOr lib.types.str;
75 The content of /etc/asusd/asusd-user-ledmodes.ron.
76 See https://asus-linux.org/asusctl/#led-keyboard-control.
82 config = lib.mkIf cfg.enable {
83 environment.systemPackages = [ cfg.package ];
89 lib.mkIf (cfg != null) {
90 source = pkgs.writeText name cfg;
95 "asusd/anime.ron" = maybeConfig "anime.ron" cfg.animeConfig;
96 "asusd/asusd.ron" = maybeConfig "asusd.ron" cfg.asusdConfig;
97 "asusd/aura.ron" = maybeConfig "aura.ron" cfg.auraConfig;
98 "asusd/profile.ron" = maybeConfig "profile.ron" cfg.profileConfig;
99 "asusd/fan_curves.ron" = maybeConfig "fan_curves.ron" cfg.fanCurvesConfig;
100 "asusd/asusd_user_ledmodes.ron" = maybeConfig "asusd_user_ledmodes.ron" cfg.userLedModesConfig;
103 services.dbus.enable = true;
104 systemd.packages = [ cfg.package ];
105 services.dbus.packages = [ cfg.package ];
106 services.udev.packages = [ cfg.package ];
107 services.supergfxd.enable = lib.mkDefault true;
109 systemd.user.services.asusd-user.enable = cfg.enableUserService;
112 meta.maintainers = pkgs.asusctl.meta.maintainers;