diff --git a/nixos/doc/manual/release-notes/rl-2505.section.md b/nixos/doc/manual/release-notes/rl-2505.section.md index 1fdaef9cc7d2e..91dbc4f4647c3 100644 --- a/nixos/doc/manual/release-notes/rl-2505.section.md +++ b/nixos/doc/manual/release-notes/rl-2505.section.md @@ -105,6 +105,12 @@ - `ps3-disc-dumper` was updated to 4.2.5, which removed the CLI project and now exclusively offers the GUI +- `asusd` has been upgraded to version 6 which supports multiple aura devices. To account for this, the single `auraConfig` configuration option has been replaced with `auraConfigs` which is an attribute set of config options per each device. The config files may also be now specified as either source files or text strings; to account for this you will need to specify that `text` is used for your existing configs, e.g.: + ```diff + -services.asusd.asusdConfig = '''file contents''' + +services.asusd.asusdConfig.text = '''file contents''' + ``` + - `timescaledb` requires manual upgrade steps. After you run ALTER EXTENSION, you must run [this SQL script](https://github.com/timescale/timescaledb-extras/blob/master/utils/2.15.X-fix_hypertable_foreign_keys.sql). For more details, see the following pull requests [#6797](https://github.com/timescale/timescaledb/pull/6797). PostgreSQL 13 is no longer supported in TimescaleDB v2.16. diff --git a/nixos/modules/services/hardware/asusd.nix b/nixos/modules/services/hardware/asusd.nix index 316164562b80d..07b39bce64f4a 100644 --- a/nixos/modules/services/hardware/asusd.nix +++ b/nixos/modules/services/hardware/asusd.nix @@ -9,74 +9,110 @@ let cfg = config.services.asusd; in { + imports = [ + (lib.mkRemovedOptionModule + [ + "services" + "asusd" + "auraConfig" + ] + '' + This option has been replaced by `services.asusd.auraConfigs' because asusd + supports multiple aura devices since version 6.0.0. + '' + ) + ]; + options = { - services.asusd = { - enable = lib.mkEnableOption "the asusd service for ASUS ROG laptops"; + services.asusd = + with lib.types; + let + configType = submodule ( + { text, source, ... }: + { + options = { + text = lib.mkOption { + default = null; + type = nullOr lines; + description = "Text of the file."; + }; - package = lib.mkPackageOption pkgs "asusctl" { }; + source = lib.mkOption { + default = null; + type = nullOr path; + description = "Path of the source file."; + }; + }; + } + ); + in + { + enable = lib.mkEnableOption "the asusd service for ASUS ROG laptops"; - enableUserService = lib.mkOption { - type = lib.types.bool; - default = false; - description = '' - Activate the asusd-user service. - ''; - }; + package = lib.mkPackageOption pkgs "asusctl" { }; - animeConfig = lib.mkOption { - type = lib.types.nullOr lib.types.str; - default = null; - description = '' - The content of /etc/asusd/anime.ron. - See https://asus-linux.org/asusctl/#anime-control. - ''; - }; + enableUserService = lib.mkOption { + type = bool; + default = false; + description = '' + Activate the asusd-user service. + ''; + }; - asusdConfig = lib.mkOption { - type = lib.types.nullOr lib.types.str; - default = null; - description = '' - The content of /etc/asusd/asusd.ron. - See https://asus-linux.org/asusctl/. - ''; - }; + animeConfig = lib.mkOption { + type = nullOr configType; + default = null; + description = '' + The content of /etc/asusd/anime.ron. + See https://asus-linux.org/asusctl/#anime-control. + ''; + }; - auraConfig = lib.mkOption { - type = lib.types.nullOr lib.types.str; - default = null; - description = '' - The content of /etc/asusd/aura.ron. - See https://asus-linux.org/asusctl/#led-keyboard-control. - ''; - }; + asusdConfig = lib.mkOption { + type = nullOr configType; + default = null; + description = '' + The content of /etc/asusd/asusd.ron. + See https://asus-linux.org/asusctl/. + ''; + }; - profileConfig = lib.mkOption { - type = lib.types.nullOr lib.types.str; - default = null; - description = '' - The content of /etc/asusd/profile.ron. - See https://asus-linux.org/asusctl/#profiles. - ''; - }; + auraConfigs = lib.mkOption { + type = attrsOf configType; + default = { }; + description = '' + The content of /etc/asusd/aura_.ron. + See https://asus-linux.org/asusctl/#led-keyboard-control. + ''; + }; - fanCurvesConfig = lib.mkOption { - type = lib.types.nullOr lib.types.str; - default = null; - description = '' - The content of /etc/asusd/fan_curves.ron. - See https://asus-linux.org/asusctl/#fan-curves. - ''; - }; + profileConfig = lib.mkOption { + type = nullOr configType; + default = null; + description = '' + The content of /etc/asusd/profile.ron. + See https://asus-linux.org/asusctl/#profiles. + ''; + }; + + fanCurvesConfig = lib.mkOption { + type = nullOr configType; + default = null; + description = '' + The content of /etc/asusd/fan_curves.ron. + See https://asus-linux.org/asusctl/#fan-curves. + ''; + }; - userLedModesConfig = lib.mkOption { - type = lib.types.nullOr lib.types.str; - default = null; - description = '' - The content of /etc/asusd/asusd-user-ledmodes.ron. - See https://asus-linux.org/asusctl/#led-keyboard-control. - ''; + userLedModesConfig = lib.mkOption { + type = nullOr configType; + default = null; + description = '' + The content of /etc/asusd/asusd-user-ledmodes.ron. + See https://asus-linux.org/asusctl/#led-keyboard-control. + ''; + }; }; - }; }; config = lib.mkIf cfg.enable { @@ -86,19 +122,23 @@ in let maybeConfig = name: cfg: - lib.mkIf (cfg != null) { - source = pkgs.writeText name cfg; - mode = "0644"; - }; + lib.mkIf (cfg != null) ( + (if (cfg.source != null) then { source = cfg.source; } else { text = cfg.text; }) + // { + mode = "0644"; + } + ); in { "asusd/anime.ron" = maybeConfig "anime.ron" cfg.animeConfig; "asusd/asusd.ron" = maybeConfig "asusd.ron" cfg.asusdConfig; - "asusd/aura.ron" = maybeConfig "aura.ron" cfg.auraConfig; "asusd/profile.ron" = maybeConfig "profile.ron" cfg.profileConfig; "asusd/fan_curves.ron" = maybeConfig "fan_curves.ron" cfg.fanCurvesConfig; "asusd/asusd_user_ledmodes.ron" = maybeConfig "asusd_user_ledmodes.ron" cfg.userLedModesConfig; - }; + } + // lib.attrsets.concatMapAttrs (prod_id: value: { + "asusd/aura_${prod_id}.ron" = maybeConfig "aura_${prod_id}.ron" value; + }) cfg.auraConfigs; services.dbus.enable = true; systemd.packages = [ cfg.package ];