about summary refs log tree commit diff
path: root/pkgs/tools/misc/wootility/default.nix
blob: c5477bb83844b3206c5e11b1aa0de0b2e5cdf144 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{ appimageTools
, fetchurl
, lib
, xorg
, udev
, wooting-udev-rules
, makeWrapper
}:

appimageTools.wrapType2 rec {
  pname = "wootility";
  version = "4.6.20";

  src = fetchurl {
    url = "https://s3.eu-west-2.amazonaws.com/wooting-update/wootility-lekker-linux-latest/wootility-lekker-${version}.AppImage";
    sha256 = "sha256-JodmF3TThPpXXx1eOnYmYAJ4x5Ylcf35bw3R++5/Buk=";
  };

  extraInstallCommands =
    let contents = appimageTools.extract { inherit pname version src; };
    in ''
      source "${makeWrapper}/nix-support/setup-hook"
      wrapProgram $out/bin/wootility \
        --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}"

      install -Dm444 ${contents}/wootility-lekker.desktop -t $out/share/applications
      install -Dm444 ${contents}/wootility-lekker.png -t $out/share/pixmaps
      substituteInPlace $out/share/applications/wootility-lekker.desktop \
        --replace-fail 'Exec=AppRun' 'Exec=wootility' \
        --replace-warn 'Name=wootility-lekker' 'Name=Wootility'
    '';

  profile = ''
    export LC_ALL=C.UTF-8
  '';

  multiPkgs = extraPkgs;
  extraPkgs =
    pkgs: (appimageTools.defaultFhsEnvArgs.multiPkgs pkgs) ++ ([
      udev
      wooting-udev-rules
      xorg.libxkbfile
    ]);

  meta = with lib; {
    homepage = "https://wooting.io/wootility";
    description = "Customization and management software for Wooting keyboards";
    platforms = [ "x86_64-linux" ];
    license = licenses.unfree;
    maintainers = with maintainers; [ davidtwco sodiboo ];
    mainProgram = "wootility";
  };
}