mirror of
https://github.com/Theaninova/TheaninovOS.git
synced 2025-12-12 11:36:20 +00:00
feat: integrate system config
This commit is contained in:
39
modules/cc1-thea
Normal file
39
modules/cc1-thea
Normal file
@@ -0,0 +1,39 @@
|
||||
xkb_symbols "cc1-thea"
|
||||
{
|
||||
include "us(basic)"
|
||||
include "level3(ralt_switch)"
|
||||
|
||||
key <AE11> {[minus, underscore, at]};
|
||||
key <AE12> {[equal, question, ssharp]};
|
||||
key <LatQ> {[q, Q, asterisk]};
|
||||
key <LatW> {[w, W, 9]};
|
||||
key <LatE> {[e, E, braceleft]};
|
||||
key <LatR> {[r, R, 1]};
|
||||
key <LatT> {[t, T, braceright]};
|
||||
key <LatY> {[y, Y, bar]};
|
||||
key <LatU> {[u, U, 5]};
|
||||
key <LatI> {[i, I, exclam]};
|
||||
key <LatO> {[o, O, 3]};
|
||||
key <LatP> {[p, P, greater]};
|
||||
key <LatA> {[a, A, 0]};
|
||||
key <LatS> {[s, S, 4]};
|
||||
key <LatD> {[d, D, parenright]};
|
||||
key <LatF> {[f, F, 6]};
|
||||
key <LatG> {[g, G, asciicircum]};
|
||||
key <LatH> {[h, H, bracketright]};
|
||||
key <LatJ> {[j, J, percent]};
|
||||
key <LatK> {[k, K, 7]};
|
||||
key <LatL> {[l, L, slash]};
|
||||
key <AC10> {[semicolon, colon, dollar, EuroSign]};
|
||||
key <AC11> {[apostrophe, quotedbl, ampersand]};
|
||||
key <LatZ> {[z, Z, dead_diaeresis]};
|
||||
key <LatX> {[x, X, plus]};
|
||||
key <LatC> {[c, C, parenleft]};
|
||||
key <LatV> {[v, V, less]};
|
||||
key <LatB> {[b, B, 8]};
|
||||
key <LatN> {[n, N, 2]};
|
||||
key <LatM> {[m, M, bracketleft, mu]};
|
||||
key <AB08> {[comma, numbersign, grave]};
|
||||
key <AB09> {[period, asciitilde, backslash]};
|
||||
};
|
||||
|
||||
29
modules/nixos/hid-fanatecff/default.nix
Normal file
29
modules/nixos/hid-fanatecff/default.nix
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
pkgs,
|
||||
lib,
|
||||
config,
|
||||
...
|
||||
}:
|
||||
with lib; let
|
||||
cfg = config.hardware.hid-fanatecff;
|
||||
kernel = config.boot.kernelPackages.kernel;
|
||||
fanatecKernelModule = pkgs.callPackage (import ./hid-fanatecff-module.nix) {kernel = kernel;};
|
||||
in {
|
||||
options.hardware.hid-fanatecff = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = lib.mkDoc ''
|
||||
Enables the Linux module drivers for Fanatec wheel bases.
|
||||
Works with the CSL Elite, and has experimental support
|
||||
for the ClubSport V2/V2.5, Podium DD1/DD2, CSR Elite and the CSL DD.
|
||||
'';
|
||||
};
|
||||
};
|
||||
config = lib.mkIf cfg.enable {
|
||||
boot = {
|
||||
extraModulePackages = [fanatecKernelModule];
|
||||
kernelModules = ["hid-fanatecff"];
|
||||
};
|
||||
};
|
||||
}
|
||||
26
modules/nixos/hid-fanatecff/hid-fanatec-fix.patch
Normal file
26
modules/nixos/hid-fanatecff/hid-fanatec-fix.patch
Normal file
@@ -0,0 +1,26 @@
|
||||
From 83e8196515ed420bbbb619e015a49a504c56d6bf Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Thea=20Sch=C3=B6bl?= <dev@theaninova.de>
|
||||
Date: Mon, 18 Sep 2023 17:18:35 +0200
|
||||
Subject: [PATCH 1/1] workaround: led compile error
|
||||
|
||||
---
|
||||
hid-ftec.h | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/hid-ftec.h b/hid-ftec.h
|
||||
index afce2c3..3ddd514 100644
|
||||
--- a/hid-ftec.h
|
||||
+++ b/hid-ftec.h
|
||||
@@ -1,6 +1,9 @@
|
||||
#ifndef __HID_FTEC_H
|
||||
#define __HID_FTEC_H
|
||||
|
||||
+// TODO: remove
|
||||
+#define CONFIG_LEDS_CLASS
|
||||
+
|
||||
#define FANATEC_VENDOR_ID 0x0eb7
|
||||
|
||||
#define CLUBSPORT_V2_WHEELBASE_DEVICE_ID 0x0001
|
||||
--
|
||||
2.41.0
|
||||
|
||||
38
modules/nixos/hid-fanatecff/hid-fanatec-makefile.patch
Normal file
38
modules/nixos/hid-fanatecff/hid-fanatec-makefile.patch
Normal file
@@ -0,0 +1,38 @@
|
||||
From 4a1395857cc00fd287926bc281ecd36fde9f45fc Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Thea=20Sch=C3=B6bl?= <dev@theaninova.de>
|
||||
Date: Mon, 18 Sep 2023 17:30:11 +0200
|
||||
Subject: [PATCH 1/1] fix: nix makefile adjustments
|
||||
|
||||
---
|
||||
Makefile | 7 ++-----
|
||||
1 file changed, 2 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 0165e72..74b113c 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -1,6 +1,5 @@
|
||||
KVERSION ?= `uname -r`
|
||||
KDIR ?= /lib/modules/${KVERSION}/build
|
||||
-MODULEDIR ?= /lib/modules/${KVERSION}/kernel/drivers/hid
|
||||
|
||||
default:
|
||||
@echo -e "\n::\033[32m Compiling Fanatec kernel module\033[0m"
|
||||
@@ -12,12 +11,10 @@ clean:
|
||||
@echo "========================================"
|
||||
$(MAKE) -C $(KDIR) M=$$PWD clean
|
||||
|
||||
-install:
|
||||
+install: default
|
||||
@echo -e "\n::\033[34m Installing Fanatec kernel module/udev rule\033[0m"
|
||||
@echo "====================================================="
|
||||
- @cp -v hid-fanatec.ko ${MODULEDIR}
|
||||
- @cp -v fanatec.rules /etc/udev/rules.d/99-fanatec.rules
|
||||
- depmod
|
||||
+ $(MAKE) -C $(KDIR) M=$$PWD INSTALL_MOD_PATH=$$out modules_install
|
||||
|
||||
uninstall:
|
||||
@echo -e "\n::\033[34m Uninstalling Fanatec kernel module/udev rule\033[0m"
|
||||
--
|
||||
2.41.0
|
||||
|
||||
37
modules/nixos/hid-fanatecff/hid-fanatecff-module.nix
Normal file
37
modules/nixos/hid-fanatecff/hid-fanatecff-module.nix
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
kernel,
|
||||
fetchFromGitHub,
|
||||
}:
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "hid-fanatecff";
|
||||
version = "0.1.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "gotzl";
|
||||
repo = "hid-fanatecff";
|
||||
rev = "9c186b51ab7c6da9abef15c73b1d9eababc302a5";
|
||||
sha256 = "14rsj4qx8vim0hx8b7a823gqbmzfginq6kpkxjfay0n1693p2895";
|
||||
};
|
||||
|
||||
nativeBuildInputs = kernel.moduleBuildDependencies;
|
||||
|
||||
makeFlags = [
|
||||
"KVERSION=${kernel.modDirVersion}"
|
||||
"KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
|
||||
];
|
||||
|
||||
patches = [
|
||||
./hid-fanatec-fix.patch
|
||||
./hid-fanatec-makefile.patch
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "Linux kernel driver that aims to add support for FANATEC devices";
|
||||
homepage = "https://github.com/gotzl/hid-fanatecff";
|
||||
license = licenses.gpl2Only;
|
||||
platforms = platforms.linux;
|
||||
broken = stdenv.isAarch64;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user