1 { lib, fetchurl, appimageTools }:
7 url = "https://github.com/the-via/releases/releases/download/v${version}/via-${version}-linux.AppImage";
8 name = "via-${version}-linux.AppImage";
9 sha256 = "sha256-+uTvmrqHK7L5VA/lUHCZZeRYPUrcVA+vjG7venxuHhs=";
11 appimageContents = appimageTools.extractType2 { inherit pname version src; };
13 appimageTools.wrapType2 {
14 inherit pname version src;
17 # Skip prompt to add udev rule.
18 # On NixOS you can add this rule with `services.udev.packages = [ pkgs.via ];`.
19 export DISABLE_SUDO_PROMPT=1
22 extraInstallCommands = ''
23 install -m 444 -D ${appimageContents}/via-nativia.desktop -t $out/share/applications
24 substituteInPlace $out/share/applications/via-nativia.desktop \
25 --replace 'Exec=AppRun' 'Exec=${pname}'
26 cp -r ${appimageContents}/usr/share/icons $out/share
28 mkdir -p $out/etc/udev/rules.d
29 echo 'KERNEL=="hidraw*", SUBSYSTEM=="hidraw", MODE="0666", TAG+="uaccess", TAG+="udev-acl"' > $out/etc/udev/rules.d/92-viia.rules
33 description = "Yet another keyboard configurator";
34 homepage = "https://caniusevia.com/";
35 license = licenses.gpl3;
36 maintainers = with maintainers; [ emilytrau ];
37 platforms = [ "x86_64-linux" ];