From f61c62266fd5012218e08aae756e378d119dcb45 Mon Sep 17 00:00:00 2001 From: "Alexander \"PapaTutuWawa" Date: Mon, 6 Sep 2021 21:13:35 +0200 Subject: [PATCH] mashu: Add a patched version of libwacom --- hosts/mashu.nix | 2 +- overlays/default.nix | 1 + overlays/surface.nix | 37 +++++++++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 overlays/surface.nix diff --git a/hosts/mashu.nix b/hosts/mashu.nix index 245cdb0..e2459b5 100644 --- a/hosts/mashu.nix +++ b/hosts/mashu.nix @@ -5,7 +5,7 @@ let in mkHost config { userName = "alexander"; hostName = "mashu"; - overlays = [ "nur" "unstable" "simple" "custom" ]; + overlays = [ "nur" "unstable" "simple" "custom" "surface" ]; hardwareImports = [ "intel" "wifi" diff --git a/overlays/default.nix b/overlays/default.nix index 1e7e42f..a760f29 100644 --- a/overlays/default.nix +++ b/overlays/default.nix @@ -14,4 +14,5 @@ unstable = import ./unstable.nix pkgs; custom = import ./custom.nix pkgs; simple = import ./simple.nix pkgs; + surface = import ./surface.nix pkgs; } diff --git a/overlays/surface.nix b/overlays/surface.nix new file mode 100644 index 0000000..d52e302 --- /dev/null +++ b/overlays/surface.nix @@ -0,0 +1,37 @@ +pkgs: final: prev: + +let + libwacomPatchesCommit = "f811946d7d8bacb3b9ee75f08c150c435ad59331"; + mkPatch = name: sha256: pkgs.fetchpatch { + name = "${name}.patch"; + url = "https://raw.githubusercontent.com/linux-surface/libwacom-surface/${libwacomPatchesCommit}/${name}.patch"; + sha256 = sha256; + }; +in { + libwacom = prev.libwacom.overrideAttrs (old: rec { + version = "1.12"; + src = prev.fetchFromGitHub { + owner = "linuxwacom"; + repo = "libwacom"; + rev = "libwacom-${version}"; + sha256 = "130jqzyb3v0knn0i8qib5rdndabj15r66ccj264gg2i53nab88x4"; + }; + + patches = [ + (mkPatch "0001-Add-support-for-BUS_VIRTUAL" "1x8jd062gz5jbddj7nm38irfy50092balsrcsjxfd07sqc6f1z7m") + (mkPatch "0002-Add-support-for-Intel-Management-Engine-bus" "0cz7ps9b8p0x62rpi2drhkwifvp99rngvz40qrlm5x2bi1drgavk") + (mkPatch "0003-data-Add-Microsoft-Surface-pro-4" "0f2kn8d25n3zr1j3xvaa50b6jf4gj8kd6pd5vp5vvl9bgs2m9l0j") + (mkPatch "0004-data-Add-Microsoft-Surface-pro-5" "17llns4kmf5hm7h5k6xnhnwxdwfyqlrqzkfr7gml89l0vr1xh194") + (mkPatch "0005-data-Add-Microsoft-Surface-pro-6" "0li3a5j8pdsa5xj69pva7008izkz4gf4vhxmwxflix0isi208ay0") + (mkPatch "0006-data-Add-Microsoft-Surface-pro-7" "0i79ja6yxm99q1xg916105k6j9m1slm7nba6h3q8z7dcj0x6ndsy") + (mkPatch "0007-data-Add-Microsoft-Surface-Book" "15hqyc6853rjd33gcnq59rl5wc42fj1xm1iin2l3f95nqk5fyqfc") + (mkPatch "0008-data-Add-Microsoft-Surface-Book-2-13.5" "1sx7v849fv225avhpi73dnf0azgwk570fv8r6ypvc5kzxz8ljjmj") + (mkPatch "0009-data-Add-Microsoft-Surface-Book-2-15" "00vyjlmgh7ziic77k5vfp9y02fdqqdc1f729y30plyvjy6vxmw11") + (mkPatch "0010-data-Add-Microsoft-Surface-Book-3-13.5" "10w6npa8lsikxjwvfzz3jhwj9dx1zg3djaq0jkmns2qqbs23s9ml") + (mkPatch "0011-data-Add-Microsoft-Surface-Book-3-15" "03yl4v9b160rbynj1zpsg3xjysj269yawz1x8jjkr6j4ka3l0ldx") + ]; + + # TODO: ??? + buildInputs = old.buildInputs ++ [prev.python3]; + }); +}