Files
nixpkgs/pkgs/by-name/ba/bazecor/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

70 lines
2.3 KiB
Nix

{
lib,
appimageTools,
fetchurl,
makeWrapper,
}:
let
pname = "bazecor";
version = "1.7.0";
src = appimageTools.extract {
inherit pname version;
src = fetchurl {
url = "https://github.com/Dygmalab/Bazecor/releases/download/v${version}/Bazecor-${version}-x64.AppImage";
hash = "sha256-i+6EBgT8Fv3GN2qwnr+QH9mcDToeQvit52qRt30Y9sM=";
};
# Workaround for https://github.com/Dygmalab/Bazecor/issues/370
postExtract = ''
substituteInPlace \
$out/usr/lib/bazecor/resources/app/.webpack/main/index.js \
--replace-fail \
'checkUdev=()=>{try{if(l.default.existsSync(h))return l.default.readFileSync(h,"utf-8").trim()===f.trim()}catch(e){d.default.error(e)}return!1}' \
'checkUdev=()=>{return 1}'
'';
};
in
appimageTools.wrapAppImage {
inherit pname version src;
# also make sure to update the udev rules in ./60-dygma.rules; most recently
# taken from
# https://github.com/Dygmalab/Bazecor/blob/v1.4.4/src/main/utils/udev.ts#L6
nativeBuildInputs = [ makeWrapper ];
extraPkgs = pkgs: [ pkgs.glib ];
# Also expose the udev rules here, so it can be used as:
# services.udev.packages = [ pkgs.bazecor ];
# to allow non-root modifications to the keyboards.
extraInstallCommands = ''
wrapProgram $out/bin/bazecor \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}"
install -m 444 -D ${src}/Bazecor.desktop -t $out/share/applications
install -m 444 -D ${src}/bazecor.png -t $out/share/pixmaps
mkdir -p $out/lib/udev/rules.d
install -m 444 -D ${./60-dygma.rules} $out/lib/udev/rules.d/60-dygma.rules
substituteInPlace $out/share/applications/Bazecor.desktop \
--replace-fail 'Exec=Bazecor' 'Exec=bazecor'
'';
meta = {
description = "Graphical configurator for Dygma Products";
homepage = "https://github.com/Dygmalab/Bazecor";
changelog = "https://github.com/Dygmalab/Bazecor/releases/tag/v${version}";
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
license = lib.licenses.gpl3Only;
maintainers = with lib.maintainers; [
amesgen
gcleroux
];
platforms = [ "x86_64-linux" ];
mainProgram = "bazecor";
};
}