1{ lib, appimageTools, fetchurl }:
2
3let
4 pname = "chrysalis";
5 version = "0.12.0";
6in appimageTools.wrapAppImage rec {
7 name = "${pname}-${version}-binary";
8
9 src = appimageTools.extract {
10 inherit name;
11 src = fetchurl {
12 url = "https://github.com/keyboardio/${pname}/releases/download/v${version}/${pname}-${version}.AppImage";
13 sha256 = "sha256-sQoEO1UII4Gbp7UbHCCyejsd94lkBbi93TH325EamFc=";
14 };
15 };
16
17 multiPkgs = null;
18 extraPkgs = p: (appimageTools.defaultFhsEnvArgs.multiPkgs p) ++ [
19 p.glib
20 ];
21
22 # Also expose the udev rules here, so it can be used as:
23 # services.udev.packages = [ pkgs.chrysalis ];
24 # to allow non-root modifications to the keyboards.
25
26 extraInstallCommands = ''
27 mv $out/bin/${name} $out/bin/${pname}
28
29 mkdir -p $out/lib/udev/rules.d
30 ln -s \
31 --target-directory=$out/lib/udev/rules.d \
32 ${src}/resources/static/udev/60-kaleidoscope.rules
33 '';
34
35 meta = with lib; {
36 description = "A graphical configurator for Kaleidoscope-powered keyboards";
37 homepage = "https://github.com/keyboardio/Chrysalis";
38 license = licenses.gpl3;
39 maintainers = with maintainers; [ aw ];
40 platforms = [ "x86_64-linux" ];
41 };
42}