From 216a21c638907d67b41d5ef7d4cb6ccbc4ab348e Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Mon, 12 Sep 2022 13:09:13 -0400 Subject: [PATCH 1/2] linuxPackages.xpadneo: 0.9.4 -> 0.9.5 --- nixos/modules/hardware/xpadneo.nix | 2 +- pkgs/os-specific/linux/xpadneo/default.nix | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/nixos/modules/hardware/xpadneo.nix b/nixos/modules/hardware/xpadneo.nix index 1e43794dc0f8..a66e81d8b15b 100644 --- a/nixos/modules/hardware/xpadneo.nix +++ b/nixos/modules/hardware/xpadneo.nix @@ -16,7 +16,7 @@ in extraModprobeConfig = mkIf (config.hardware.bluetooth.enable && - (lib.versionOlder config.boot.kernelPackages.kernel.version "5.12")) + (lib.versionOlder config.boot.kernelPackages.kernel.version "5.12")) "options bluetooth disable_ertm=1"; extraModulePackages = with config.boot.kernelPackages; [ xpadneo ]; diff --git a/pkgs/os-specific/linux/xpadneo/default.nix b/pkgs/os-specific/linux/xpadneo/default.nix index 623b881cd0f2..7b3f8e5a9b18 100644 --- a/pkgs/os-specific/linux/xpadneo/default.nix +++ b/pkgs/os-specific/linux/xpadneo/default.nix @@ -1,14 +1,14 @@ { lib, stdenv, fetchFromGitHub, kernel, bluez }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "xpadneo"; - version = "0.9.4"; + version = "0.9.5"; src = fetchFromGitHub { owner = "atar-axis"; - repo = pname; - rev = "refs/tags/v${version}"; - sha256 = "sha256-4zd+x9uYl0lJgePM9LEgLYFqvcw6VPF/CbR1XiYSwGE="; + repo = "xpadneo"; + rev = "refs/tags/v${finalAttrs.version}"; + sha256 = "sha256-rT2Mq40fE055FemDG7PBjt+cxgIHJG9tTjtw2nW6B98="; }; setSourceRoot = '' @@ -22,7 +22,7 @@ stdenv.mkDerivation rec { "-C" "${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" "M=$(sourceRoot)" - "VERSION=${version}" + "VERSION=${finalAttrs.version}" ]; buildFlags = [ "modules" ]; @@ -36,4 +36,4 @@ stdenv.mkDerivation rec { maintainers = with maintainers; [ kira-bruneau ]; platforms = platforms.linux; }; -} +}) From 2a916b6c292f89a2073bff29e49c50d7fe9af2e5 Mon Sep 17 00:00:00 2001 From: Kira Bruneau Date: Tue, 20 Sep 2022 19:39:13 -0400 Subject: [PATCH 2/2] nixos/xpadneo: add sanity test --- nixos/tests/all-tests.nix | 1 + nixos/tests/xpadneo.nix | 18 ++++++++++++++++++ pkgs/os-specific/linux/xpadneo/default.nix | 12 +++++++++++- 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 nixos/tests/xpadneo.nix diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index e0121fe6b6b8..e4643b79add3 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -633,6 +633,7 @@ in { xfce = handleTest ./xfce.nix {}; xmonad = handleTest ./xmonad.nix {}; xmonad-xdg-autostart = handleTest ./xmonad-xdg-autostart.nix {}; + xpadneo = handleTest ./xpadneo.nix {}; xrdp = handleTest ./xrdp.nix {}; xss-lock = handleTest ./xss-lock.nix {}; xterm = handleTest ./xterm.nix {}; diff --git a/nixos/tests/xpadneo.nix b/nixos/tests/xpadneo.nix new file mode 100644 index 000000000000..c7b72831fce8 --- /dev/null +++ b/nixos/tests/xpadneo.nix @@ -0,0 +1,18 @@ +import ./make-test-python.nix ({ lib, pkgs, ... }: { + name = "xpadneo"; + meta.maintainers = with lib.maintainers; [ kira-bruneau ]; + + nodes = { + machine = { + config.hardware.xpadneo.enable = true; + }; + }; + + # This is just a sanity check to make sure the module was + # loaded. We'd have to find some way to mock an xbox controller if + # we wanted more in-depth testing. + testScript = '' + machine.start(); + machine.succeed("modinfo hid_xpadneo | grep 'version:\s\+${pkgs.linuxPackages.xpadneo.version}'") + ''; +}) diff --git a/pkgs/os-specific/linux/xpadneo/default.nix b/pkgs/os-specific/linux/xpadneo/default.nix index 7b3f8e5a9b18..bb47bf03f58a 100644 --- a/pkgs/os-specific/linux/xpadneo/default.nix +++ b/pkgs/os-specific/linux/xpadneo/default.nix @@ -1,4 +1,10 @@ -{ lib, stdenv, fetchFromGitHub, kernel, bluez }: +{ lib +, stdenv +, fetchFromGitHub +, kernel +, bluez +, nixosTests +}: stdenv.mkDerivation (finalAttrs: { pname = "xpadneo"; @@ -29,6 +35,10 @@ stdenv.mkDerivation (finalAttrs: { installFlags = [ "INSTALL_MOD_PATH=${placeholder "out"}" ]; installTargets = [ "modules_install" ]; + passthru.tests = { + xpadneo = nixosTests.xpadneo; + }; + meta = with lib; { description = "Advanced Linux driver for Xbox One wireless controllers"; homepage = "https://atar-axis.github.io/xpadneo";