Merge pull request #133761 from utdemir/ud/chrysalis-expose-udev

This commit is contained in:
Sandro 2021-08-13 17:12:34 +02:00 committed by GitHub
commit dd2ed37c4a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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";