2021-07-14 22:03:04 +00:00
|
|
|
{ lib, fetchurl, appimageTools }:
|
|
|
|
|
|
|
|
let
|
|
|
|
pname = "via";
|
2023-03-30 22:05:00 +00:00
|
|
|
version = "3.0.0";
|
2021-07-14 22:03:04 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/the-via/releases/releases/download/v${version}/via-${version}-linux.AppImage";
|
|
|
|
name = "via-${version}-linux.AppImage";
|
2023-03-30 22:05:00 +00:00
|
|
|
sha256 = "sha256-+uTvmrqHK7L5VA/lUHCZZeRYPUrcVA+vjG7venxuHhs=";
|
2021-07-14 22:03:04 +00:00
|
|
|
};
|
2024-05-15 15:35:15 +00:00
|
|
|
appimageContents = appimageTools.extractType2 { inherit pname version src; };
|
2023-02-22 10:55:15 +00:00
|
|
|
in
|
|
|
|
appimageTools.wrapType2 {
|
2024-05-15 15:35:15 +00:00
|
|
|
inherit pname version src;
|
2021-07-14 22:03:04 +00:00
|
|
|
|
|
|
|
profile = ''
|
|
|
|
# Skip prompt to add udev rule.
|
|
|
|
# On NixOS you can add this rule with `services.udev.packages = [ pkgs.via ];`.
|
|
|
|
export DISABLE_SUDO_PROMPT=1
|
|
|
|
'';
|
|
|
|
|
|
|
|
extraInstallCommands = ''
|
2022-08-21 13:32:41 +00:00
|
|
|
install -m 444 -D ${appimageContents}/via-nativia.desktop -t $out/share/applications
|
|
|
|
substituteInPlace $out/share/applications/via-nativia.desktop \
|
2021-07-14 22:03:04 +00:00
|
|
|
--replace 'Exec=AppRun' 'Exec=${pname}'
|
|
|
|
cp -r ${appimageContents}/usr/share/icons $out/share
|
|
|
|
|
|
|
|
mkdir -p $out/etc/udev/rules.d
|
|
|
|
echo 'KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0666", TAG+="uaccess", TAG+="udev-acl"' > $out/etc/udev/rules.d/92-viia.rules
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Yet another keyboard configurator";
|
|
|
|
homepage = "https://caniusevia.com/";
|
2022-08-21 13:32:41 +00:00
|
|
|
license = licenses.gpl3;
|
2022-02-20 05:27:41 +00:00
|
|
|
maintainers = with maintainers; [ emilytrau ];
|
2021-07-14 22:03:04 +00:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "via";
|
2021-07-14 22:03:04 +00:00
|
|
|
};
|
|
|
|
}
|