From f19608d24dad587f75fcb3941204fa28dc76a335 Mon Sep 17 00:00:00 2001 From: Angus Trau Date: Tue, 6 Jul 2021 10:31:36 +1000 Subject: [PATCH 1/2] maintainers: add angustrau --- maintainers/maintainer-list.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 9aaa726485db..b51e77616259 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -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"; From 20ed7aa414884a7870629201fec1a86e3682fc0a Mon Sep 17 00:00:00 2001 From: Angus Trau Date: Tue, 6 Jul 2021 10:47:00 +1000 Subject: [PATCH 2/2] via: init at 1.3.1 --- pkgs/tools/misc/via/default.nix | 41 +++++++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 43 insertions(+) create mode 100644 pkgs/tools/misc/via/default.nix diff --git a/pkgs/tools/misc/via/default.nix b/pkgs/tools/misc/via/default.nix new file mode 100644 index 000000000000..5667c8a4c46c --- /dev/null +++ b/pkgs/tools/misc/via/default.nix @@ -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" ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 878613f1359e..ff2797d5f4a1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9610,6 +9610,8 @@ in inherit lib udisks2 python3; }; + via = callPackage ../tools/misc/via {}; + viking = callPackage ../applications/misc/viking { }; vim-vint = callPackage ../development/tools/vim-vint { };