input-remapper: Remove as it is upstream

This commit is contained in:
PapaTutuWawa 2022-05-11 15:24:14 +02:00
parent 648da7e05a
commit ffaf192563
6 changed files with 13 additions and 127 deletions

View File

@ -81,7 +81,7 @@
gamemode.enable = true;
gnome.enable = true;
input-remapper = {
enable = false;
enable = true;
postStartCommand = "${pkgs.input-remapper}/bin/input-remapper-control --command start --preset NOOP --device \"Razer Razer Tartarus V2\"";
};
gdm = {
@ -112,6 +112,7 @@
# enable = true;
# dockerCompat = true;
#};
docker.enable = true;
};
boot = let

View File

@ -14,27 +14,16 @@ in {
config = lib.mkIf cfg.enable {
# TODO: Assert that uinput is in kernelModules
services.udev = {
packages = with pkgs; [ input-remapper ];
extraRules = ''
KERNEL=="uinput", GROUP="input", MODE="0660"
'';
};
environment.systemPackages = [
pkgs.input-remapper # Custom package
];
systemd.user.services.input-remapper = {
description = "A tool to change the mapping of your input device buttons";
wantedBy = [ "default.target" ];
serviceConfig = {
Type = "simple";
ExecStart = "${pkgs.input-remapper}/bin/input-remapper-service";
Restart = "always";
# NOTE: The Tartarus may not be connected, so don't fail if we cannot set the preset
ExecStartPost = cfg.postStartCommand;
};
#services.udev = {
# packages = with pkgs; [ input-remapper ];
# extraRules = ''
# KERNEL=="uinput", GROUP="input", MODE="0660"
# '';
#};
services.input-remapper = {
enable = true;
enableUdevRules = true;
serviceWantedBy = [ "default.target" ];
};
};
}

View File

@ -13,7 +13,6 @@ let
in {
inherit discord-system-electron;
input-remapper = prev.callPackage ./tools/games/input-remapper {};
vfio-isolate = prev.callPackage ./tools/virtualisation/vfio-isolate {};
mopidy-funkwhale = prev.callPackage ./applications/audio/mopidy/funkwhale.nix {};
python3Packages = prev.python3Packages // {

View File

@ -1,17 +0,0 @@
diff --git a/setup.py b/setup.py
index 1d50118..fde6119 100644
--- a/setup.py
+++ b/setup.py
@@ -129,6 +129,12 @@ setup(
("/usr/bin/", ["bin/key-mapper-service"]),
("/usr/bin/", ["bin/key-mapper-control"]),
],
+ scripts=[
+ "bin/input-remapper-gtk",
+ "bin/input-remapper-service",
+ "bin/input-remapper-control",
+ "bin/input-remapper-helper"
+ ],
install_requires=[
"setuptools",
"evdev",

View File

@ -1,74 +0,0 @@
{
pkgs, lib
, python3Packages, python3
, gtk3, gobject-introspection, git, gnome, gtksourceview4
, wrapGAppsHook
, makeDesktopItem
, fetchFromGitHub
}:
python3Packages.buildPythonApplication rec {
pname = "input-remapper";
version = "1.4.0";
buildInputs = [ gobject-introspection gtk3 gnome.adwaita-icon-theme gtksourceview4 ];
nativeBuildInputs = [ wrapGAppsHook ];
propagatedBuildInputs = with python3.pkgs; [ setuptools pydbus evdev pygobject3 ];
src = fetchFromGitHub {
owner = "sezanzeb";
repo = "input-remapper";
rev = version;
sha256 = "0h64cblpfz2zk15r2ja1kww1cw54gywmfr1zc16qx7sbjy0yi8px";
};
doCheck = false;
strictDeps = false;
patches = [
./add-scripts.patch
./hack-data-dir.patch
];
# Fix input-remapper not finding its data files
preBuild = ''
sed -e "s|@@NIXOS_OUT_PATH@@|$out/usr/share/input-remapper|" --in-place inputremapper/data.py
'';
# Required as we otherwise don't get the dbus policy installed
# correctly
preInstall = ''
# see https://github.com/pypa/setuptools/issues/130
${python3}/bin/${python3.executable} setup.py install_data --install-dir=$out --root=$out
'';
postInstall = ''
# Install the udev rules
mkdir -p $out/lib/udev/rules.d
cp data/99-input-remapper.rules $out/lib/udev/rules.d/99-input-remapper.rules
sed --in-place -e "s|/bin/input-remapper-control|$out/bin/input-remapper-control|" $out/lib/udev/rules.d/99-input-remapper.rules
# Install the desktop file
mkdir -p $out/share/icons/hicolor/scalable/apps/
cp -r ${desktopItem}/share/applications $out/share/
cp $out/usr/share/input-remapper/input-remapper.svg $out/share/icons/hicolor/scalable/apps/input-remapper.svg
'';
desktopItem = makeDesktopItem {
name = "input-remapper";
exec = "input-remapper-gtk";
icon = "input-remapper";
desktopName = "input-remapper";
genericName = "input-remapper";
};
meta = with lib; {
homepage = "https://github.com/sezanzeb/input-remapper";
description = "A tool to change the mapping of your input device buttons";
license = licenses.gpl3;
maintainers = [ ];
platforms = lib.platforms.linux;
};
}

View File

@ -1,12 +0,0 @@
diff --git a/inputremapper/data.py b/inputremapper/data.py
index d5ec3a8..9fec89f 100644
--- a/inputremapper/data.py
+++ b/inputremapper/data.py
@@ -68,6 +68,7 @@ def get_data_path(filename=""):
"/usr/share/input-remapper",
"/usr/local/share/input-remapper",
os.path.join(site.USER_BASE, "share/input-remapper"),
+ "@@NIXOS_OUT_PATH@@",
]
if data is None: