diff options
author | Vladimír Čunát <v@cunat.cz> | 2022-07-18 08:29:53 +0200 |
---|---|---|
committer | Vladimír Čunát <v@cunat.cz> | 2022-07-18 08:29:53 +0200 |
commit | 250922fd1e061f2132d33b778424f4e9ed42354a (patch) | |
tree | c26970f54a01d8d612c82818de8d2104172b9fa0 /pkgs/applications/misc/streamdeck-ui/default.nix | |
parent | 0ff0b14968e7474fbb917fbb096a8d89d121922f (diff) | |
parent | 950a258b9ef24ca4346bbf722a694c2ab54e4654 (diff) | |
download | nixpkgs-250922fd1e061f2132d33b778424f4e9ed42354a.tar nixpkgs-250922fd1e061f2132d33b778424f4e9ed42354a.tar.gz nixpkgs-250922fd1e061f2132d33b778424f4e9ed42354a.tar.bz2 nixpkgs-250922fd1e061f2132d33b778424f4e9ed42354a.tar.lz nixpkgs-250922fd1e061f2132d33b778424f4e9ed42354a.tar.xz nixpkgs-250922fd1e061f2132d33b778424f4e9ed42354a.tar.zst nixpkgs-250922fd1e061f2132d33b778424f4e9ed42354a.zip |
Merge branch 'master' into staging-next
Diffstat (limited to 'pkgs/applications/misc/streamdeck-ui/default.nix')
-rw-r--r-- | pkgs/applications/misc/streamdeck-ui/default.nix | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/pkgs/applications/misc/streamdeck-ui/default.nix b/pkgs/applications/misc/streamdeck-ui/default.nix new file mode 100644 index 00000000000..141652e63d6 --- /dev/null +++ b/pkgs/applications/misc/streamdeck-ui/default.nix @@ -0,0 +1,95 @@ +{ lib +, python3Packages +, fetchFromGitHub +, poetry +, copyDesktopItems +, wrapQtAppsHook +, writeText +, makeDesktopItem +, xvfb-run +}: + +python3Packages.buildPythonApplication rec { + pname = "streamdeck-ui"; + version = "2.0.4"; + + src = fetchFromGitHub { + repo = pname; + owner = "timothycrosley"; + rev = "v${version}"; + hash = "sha256-NV4BkHEgfxIOuLfmn0vcPNqivmHLD6v7jLdLZgnrb0Q="; + }; + + desktopItems = [ (makeDesktopItem { + name = "streamdeck-ui"; + desktopName = "Stream Deck UI"; + icon = "streamdeck-ui"; + exec = "streamdeck --no-ui"; + comment = "UI for the Elgato Stream Deck"; + categories = [ "Utility" ]; + noDisplay = true; + }) ]; + + postInstall = + let + udevRules = '' + SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0060", TAG+="uaccess" + SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0063", TAG+="uaccess" + SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="006c", TAG+="uaccess" + SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="006d", TAG+="uaccess" + SUBSYSTEM=="usb", ATTRS{idVendor}=="0fd9", ATTRS{idProduct}=="0080", TAG+="uaccess" + ''; + in + '' + mkdir -p "$out/etc/udev/rules.d" + cp ${writeText "70-streamdeck.rules" udevRules} $out/etc/udev/rules.d/70-streamdeck.rules + + mkdir -p "$out/share/pixmaps" + cp streamdeck_ui/logo.png $out/share/pixmaps/streamdeck-ui.png + ''; + + dontWrapQtApps = true; + makeWrapperArgs = [ "\${qtWrapperArgs[@]}" ]; + + format = "pyproject"; + + nativeBuildInputs = [ + poetry + copyDesktopItems + wrapQtAppsHook + ]; + + propagatedBuildInputs = with python3Packages; [ + setuptools + filetype + cairosvg + pillow + pynput + pyside2 + streamdeck + xlib + ]; + + checkInputs = [ + xvfb-run + python3Packages.pytest + python3Packages.hypothesis-auto + ]; + + # Ignored tests are not in a running or passing state. + # Fixes have been merged upstream but not yet released. + # Revisit these ignored tests on each update. + checkPhase = '' + xvfb-run pytest tests \ + --ignore=tests/test_api.py \ + --ignore=tests/test_filter.py \ + --ignore=tests/test_stream_deck_monitor.py + ''; + + meta = with lib; { + description = "Linux compatible UI for the Elgato Stream Deck"; + homepage = "https://timothycrosley.github.io/streamdeck-ui/"; + license = licenses.mit; + maintainers = with maintainers; [ majiir ]; + }; +} |