update system

This commit is contained in:
2024-04-23 20:41:23 +02:00
parent 49c7d031d0
commit 0f90ac4ed1
7 changed files with 55 additions and 35 deletions

View File

@@ -3,6 +3,8 @@
stdenv,
kernel,
fetchFromGitHub,
linuxConsoleTools,
bash,
}:
stdenv.mkDerivation rec {
@@ -12,7 +14,7 @@ stdenv.mkDerivation rec {
src = fetchFromGitHub {
owner = "gotzl";
repo = "hid-fanatecff";
rev = "0.1";
rev = lib.versions.majorMinor version;
hash = "sha256-1Nm/34Er/qfel9LJp++IWd7cTh2Wi93Kgd28YLMVvWo=";
};
@@ -23,11 +25,27 @@ stdenv.mkDerivation rec {
"KERNEL_SRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
];
patchPhase = ''
runHook prePatch
substituteInPlace fanatec.rules \
--replace-fail "/bin/sh" "${bash}/bin/sh"
substituteInPlace fanatec.rules \
--replace-fail "/usr/bin/evdev-joystick" "${linuxConsoleTools}/bin/evdev-joystick"
runHook postPatch
'';
installPhase = ''
runHook preInstall
mkdir -p $out/etc/udev/rules.d
cp ${src}/fanatec.rules $out/etc/udev/rules.d/99-fanatec.rules
cp fanatec.rules $out/etc/udev/rules.d/99-fanatec.rules
mkdir -p $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/hid
cp hid-fanatec.ko $out/lib/modules/${kernel.modDirVersion}/kernel/drivers/hid
runHook postInstall
'';
meta = with lib; {

View File

@@ -5,8 +5,6 @@
...
}:
with lib;
let
cfg = config.hardware.hid-fanatecff;
kernelPackage = pkgs.callPackage ./hid-fanatecff-pkg.nix {
@@ -14,28 +12,18 @@ let
};
in
{
options.hardware.hid-fanatecff = {
enable = mkOption {
type = types.bool;
default = false;
example = true;
description = lib.mdDoc ''
Enables the Linux module drivers for Fanatec wheel bases.
Works with the CSL Elite and CSL/ClubSport DD/DD Pro,
and has experimental support for the ClubSport V2/V2.5,
Podium DD1/DD2 and CSR Elite.
'';
};
};
options.hardware.hid-fanatecff.enable = lib.mkEnableOption "the Linux kernel drivers for Fanatec wheel bases";
config = lib.mkIf cfg.enable {
boot = {
extraModulePackages = [ kernelPackage ];
kernelModules = [ "hid-fanatecff" ];
kernelModules = [ "hid-fanatec" ];
};
services.udev.packages = [ kernelPackage ];
users.groups.games = { };
};
meta = {
maintainers = with maintainers; [ theaninova ];
maintainers = with lib.maintainers; [ theaninova ];
};
}