2022-05-15 02:08:10 +00:00
|
|
|
{ lib, appimageTools, fetchurl }:
|
2020-11-03 13:58:14 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
pname = "chrysalis";
|
2024-01-19 20:37:01 +00:00
|
|
|
version = "0.13.3";
|
2020-11-03 13:58:14 +00:00
|
|
|
name = "${pname}-${version}-binary";
|
2023-08-04 19:29:04 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url =
|
|
|
|
"https://github.com/keyboardio/${pname}/releases/download/v${version}/${pname}-${version}-x64.AppImage";
|
|
|
|
hash =
|
2024-01-19 20:37:01 +00:00
|
|
|
"sha512-F6Y87rgIclj1OA3gVX/gqqp9AvXKQlBXrbqk/26F1KHPF9NzHJgVmeszSo3Nhb6xg4CzWmzkqc8IW2H/Bg57kw==";
|
2020-11-03 13:58:14 +00:00
|
|
|
};
|
2023-08-04 19:29:04 +00:00
|
|
|
appimageContents = appimageTools.extract { inherit name src; };
|
|
|
|
in appimageTools.wrapType2 rec {
|
|
|
|
inherit name pname src;
|
2020-11-03 13:58:14 +00:00
|
|
|
|
2023-07-01 11:35:55 +00:00
|
|
|
multiArch = false;
|
2023-08-04 19:29:04 +00:00
|
|
|
extraPkgs = p: (appimageTools.defaultFhsEnvArgs.multiPkgs p) ++ [ p.glib ];
|
2020-11-03 13:58:14 +00:00
|
|
|
|
2021-08-13 11:57:45 +00:00
|
|
|
# Also expose the udev rules here, so it can be used as:
|
|
|
|
# services.udev.packages = [ pkgs.chrysalis ];
|
|
|
|
# to allow non-root modifications to the keyboards.
|
|
|
|
|
|
|
|
extraInstallCommands = ''
|
2023-08-04 19:29:04 +00:00
|
|
|
mv $out/bin/{${name},${pname}}
|
|
|
|
|
|
|
|
install -m 444 \
|
|
|
|
-D ${appimageContents}/usr/lib/chrysalis/resources/static/udev/60-kaleidoscope.rules \
|
|
|
|
-t $out/lib/udev/rules.d
|
|
|
|
|
|
|
|
install -m 444 \
|
|
|
|
-D ${appimageContents}/Chrysalis.desktop \
|
|
|
|
-t $out/share/applications
|
|
|
|
substituteInPlace \
|
|
|
|
$out/share/applications/Chrysalis.desktop \
|
|
|
|
--replace 'Exec=Chrysalis' 'Exec=${pname}'
|
2021-08-13 11:57:45 +00:00
|
|
|
|
2023-11-27 00:28:39 +00:00
|
|
|
install -Dm444 ${appimageContents}/usr/share/icons/hicolor/256x256/chrysalis.png -t $out/share/pixmaps
|
2021-08-13 11:57:45 +00:00
|
|
|
'';
|
2020-11-03 13:58:14 +00:00
|
|
|
|
2024-01-19 20:40:40 +00:00
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
|
2020-11-03 13:58:14 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A graphical configurator for Kaleidoscope-powered keyboards";
|
|
|
|
homepage = "https://github.com/keyboardio/Chrysalis";
|
2023-11-27 00:29:43 +00:00
|
|
|
license = licenses.gpl3Only;
|
2024-01-19 20:41:08 +00:00
|
|
|
maintainers = with maintainers; [ aw eclairevoyant nshalman ];
|
2020-11-03 13:58:14 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2023-12-20 02:45:17 +00:00
|
|
|
mainProgram = "chrysalis";
|
2020-11-03 13:58:14 +00:00
|
|
|
};
|
|
|
|
}
|