chrysalis: Expose udev rules

This commit is contained in:
Utku Demir 2021-08-13 23:57:45 +12:00
parent c36f3f4c6a
commit ef5f625c5c
No known key found for this signature in database
GPG key ID: F3F8629C3E0BF60B

View file

@ -3,12 +3,15 @@
let
pname = "chrysalis";
version = "0.8.4";
in appimageTools.wrapType2 rec {
in appimageTools.wrapAppImage rec {
name = "${pname}-${version}-binary";
src = fetchurl {
url = "https://github.com/keyboardio/${pname}/releases/download/v${version}/${pname}-${version}.AppImage";
sha256 = "b41f3e23dac855b1588cff141e3d317f96baff929a0543c79fccee0c6f095bc7";
src = appimageTools.extract {
inherit name;
src = fetchurl {
url = "https://github.com/keyboardio/${pname}/releases/download/v${version}/${pname}-${version}.AppImage";
sha256 = "b41f3e23dac855b1588cff141e3d317f96baff929a0543c79fccee0c6f095bc7";
};
};
profile = ''
@ -20,7 +23,18 @@ in appimageTools.wrapType2 rec {
p.glib
];
extraInstallCommands = "mv $out/bin/${name} $out/bin/${pname}";
# 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 = ''
mv $out/bin/${name} $out/bin/${pname}
mkdir -p $out/lib/udev/rules.d
ln -s \
--target-directory=$out/lib/udev/rules.d \
${src}/resources/static/udev/60-kaleidoscope.rules
'';
meta = with lib; {
description = "A graphical configurator for Kaleidoscope-powered keyboards";