nix/overlay/Keyd.nix

43 lines
1.1 KiB
Nix
Raw Normal View History

2024-05-28 21:29:28 +03:00
# HACK: Add a patch for https://github.com/rvaiya/keyd/pull/545
{
2024-11-04 04:37:29 +03:00
lib,
util,
...
}: {
nixpkgs.overlays = [(final: prev: {
keyd = prev.keyd.overrideAttrs (old: rec {
patches = (old.patches or [ ]) ++ [
(prev.fetchpatch {
hash = "sha256-aal8oAXws6DcpeCl7G9GMJQXeLDDbyotWFut0Rf82WI=";
url = "https://patch-diff.githubusercontent.com/raw/rvaiya/keyd/pull/545.patch";
})
];
2024-05-28 21:29:28 +03:00
2024-11-04 04:37:29 +03:00
postInstall = let
pypkgs = prev.python3.pkgs;
appMap = pypkgs.buildPythonApplication rec {
inherit (prev.keyd) version src;
inherit patches;
dontBuild = true;
format = "other";
meta.mainProgram = "keyd-application-mapper";
pname = "keyd-application-mapper";
postPatch = util.trimTabs ''
substituteInPlace scripts/${pname} \
--replace /bin/sh ${prev.runtimeShell}
'';
propagatedBuildInputs = with pypkgs; [
xlib
];
installPhase = util.trimTabs ''
install -Dm555 -t $out/bin scripts/${pname}
'';
};
in ''
ln -sf ${lib.getExe appMap} $out/bin/${appMap.pname}
rm -rf $out/etc
'';
});
})];
2024-05-28 14:18:25 +03:00
}