nixos/tuxedo-control-center: warn if tuxedo-keyboard is too old

Tuxedo Control Center has a minimum version requirement on the version
of the "tuxedo_io" kernel module (at runtime).
This commit is contained in:
Florian Warzecha
2022-12-10 00:47:18 +01:00
parent 7c7c9c531c
commit 100ebc9d17
3 changed files with 17 additions and 5 deletions

View File

@@ -4,6 +4,7 @@ with lib;
let
cfg = config.hardware.tuxedo-control-center;
tuxedo-keyboard = config.boot.kernelPackages.tuxedo-keyboard;
tuxedo-control-center = pkgs.callPackage ./tuxedo-control-center {};
in
@@ -30,7 +31,20 @@ in
config = mkIf cfg.enable {
hardware.tuxedo-keyboard.enable = true;
boot.kernelModules = [ "tuxedo_io" ];
boot.kernelModules = [
# Tuxedo Control Center has a requirement on the minimum version
# of "tuxedo_io" kernel module.
# The exact requirement is currently in the
# "src/native-lib/tuxedo_io_lib/tuxedo_io_ioctl.h" file of tuxedo-control-center
# (i.e. the #define of MOD_API_MIN_VERSION).
# The respective version of the module itself is in the
# "src/tuxedo_io/tuxedo_io.c" file of tuxedo-keyboard
# (i.e. the #define of MODULE_VERSION).
(warnIf
((builtins.compareVersions tuxedo-keyboard.version "3.1.0") < 0)
"Tuxedo Control Center requires at least version 3.1.0 of tuxedo-keyboard (0.2.6 tuxedo_io kernel module); current version is ${tuxedo-keyboard.version}"
"tuxedo_io")
];
environment.systemPackages = [ cfg.package ];
services.dbus.packages = [ cfg.package ];

View File

@@ -2,4 +2,5 @@
1. Run `update.sh` and pass the version you want to update to as a parameter. For example: `./update.sh 1.0.9`
1. Bump the version and SHA-256 of `tuxedo-control-center` in [default.nix](./default.nix).
1. Adjust the version check of `tuxedo-keyboard` in [module.nix](../module.nix).
1. Build and test.

View File

@@ -6,10 +6,7 @@
let
## Update Instructions
#
# 1. Run `./update.sh` and pass the version you want to update to as
# a parameter. For example: `./update.sh 1.1.1`
# 2. Bump the version attribute and src SHA-256 here.
# 3. Build and test.
# see ./README.md
version = "1.2.2";
# keep in sync with update.sh!