system76-keyboard-configurator: build on darwin

The build produces a binary that is usable. The build does not produce
a native .app bundle because the build system depends on iconutil from
Xcode, which is impure.

Even if we switch to icnsutil, there are more issues with their
`deploy.py` script that would require a complete rewrite to accommodate
nix.
This commit is contained in:
Ihar Hrachyshka
2025-12-10 21:07:01 -05:00
@@ -1,5 +1,6 @@
{
lib,
stdenv,
fetchFromGitHub,
rustPlatform,
gtk3,
@@ -36,12 +37,14 @@ rustPlatform.buildRustPackage rec {
gtk3
hidapi
libusb1
]
++ lib.optionals stdenv.hostPlatform.isLinux [
udev
];
cargoHash = "sha256-0UmEWQz+8fKx8Z1slVuVZeiWN9JKjEKINgXzZ6a4jkE=";
postInstall = ''
postInstall = lib.optionalString stdenv.hostPlatform.isLinux ''
install -Dm444 linux/com.system76.keyboardconfigurator.desktop -t $out/share/applications
cp -r data/icons $out/share
'';
@@ -52,6 +55,6 @@ rustPlatform.buildRustPackage rec {
homepage = "https://github.com/pop-os/keyboard-configurator";
license = with lib.licenses; [ gpl3Only ];
maintainers = with lib.maintainers; [ mirrexagon ];
platforms = lib.platforms.linux;
platforms = with lib.platforms; linux ++ darwin;
};
}