Merge pull request #129537 from angustrau/via

This commit is contained in:
Sandro 2021-07-08 12:06:28 +02:00 committed by GitHub
commit 5c5e62502e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 49 additions and 0 deletions

View file

@ -680,6 +680,12 @@
githubId = 11699655;
name = "Stanislas Lange";
};
angustrau = {
name = "Angus Trau";
email = "nix@angus.ws";
github = "angustrau";
githubId = 13267947;
};
anhdle14 = {
name = "Le Anh Duc";
email = "anhdle14@icloud.com";

View file

@ -0,0 +1,41 @@
{ lib, fetchurl, appimageTools }:
let
pname = "via";
version = "1.3.1";
name = "${pname}-${version}";
nameExecutable = pname;
src = fetchurl {
url = "https://github.com/the-via/releases/releases/download/v${version}/via-${version}-linux.AppImage";
name = "via-${version}-linux.AppImage";
sha256 = "d2cd73d280a265149fedb24161ec7c575523596c4d30898ad6b5875e09b3f34a";
};
appimageContents = appimageTools.extractType2 { inherit name src; };
in appimageTools.wrapType2 {
inherit name src;
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 = ''
mv $out/bin/${name} $out/bin/${pname}
install -m 444 -D ${appimageContents}/via.desktop -t $out/share/applications
substituteInPlace $out/share/applications/via.desktop \
--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/";
license = licenses.unfree;
maintainers = with maintainers; [ angustrau ];
platforms = [ "x86_64-linux" ];
};
}

View file

@ -9617,6 +9617,8 @@ in
inherit lib udisks2 python3;
};
via = callPackage ../tools/misc/via {};
viking = callPackage ../applications/misc/viking { };
vim-vint = callPackage ../development/tools/vim-vint { };