Files
nixpkgs/pkgs/by-name/xr/xremap/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

86 lines
2.0 KiB
Nix

{
lib,
rustPlatform,
fetchFromGitHub,
pkg-config,
}:
let
pname = "xremap";
version = "0.14.1";
src = fetchFromGitHub {
owner = "xremap";
repo = "xremap";
tag = "v${version}";
hash = "sha256-80Fzf5hnRBWx0NxV1z8majc7JbDNj0DZSRNkbPvI7Ck=";
};
cargoHash = "sha256-T/UMNRPGpXjrSqq+cNVtCckYRQbJJAF5tUwWnrIjj8M=";
buildXremap =
{
suffix ? "",
features ? [ ],
descriptionSuffix ? "",
}:
assert descriptionSuffix != "" && features != [ ];
rustPlatform.buildRustPackage {
pname = "${pname}${suffix}";
inherit version src cargoHash;
nativeBuildInputs = [ pkg-config ];
buildNoDefaultFeatures = true;
buildFeatures = features;
meta = {
description =
"Key remapper for X11 and Wayland"
+ lib.optionalString (descriptionSuffix != "") " (${descriptionSuffix} support)";
homepage = "https://github.com/xremap/xremap";
changelog = "https://github.com/xremap/xremap/blob/${src.tag}/CHANGELOG.md";
license = lib.licenses.mit;
mainProgram = "xremap";
maintainers = [ lib.maintainers.hakan-demirli ];
platforms = lib.platforms.linux;
};
};
variants = {
x11 = buildXremap {
features = [ "x11" ];
descriptionSuffix = "X11";
};
gnome = buildXremap {
suffix = "-gnome";
features = [ "gnome" ];
descriptionSuffix = "Gnome";
};
kde = buildXremap {
suffix = "-kde";
features = [ "kde" ];
descriptionSuffix = "KDE";
};
wlroots = buildXremap {
suffix = "-wlroots";
features = [ "wlroots" ];
descriptionSuffix = "wlroots";
};
hyprland = buildXremap {
suffix = "-hyprland";
features = [ "hypr" ];
descriptionSuffix = "Hyprland";
};
};
in
variants.wlroots.overrideAttrs (finalAttrs: {
passthru = {
gnome = variants.gnome;
kde = variants.kde;
wlroots = variants.wlroots;
hyprland = variants.hyprland;
x11 = variants.x11;
};
})