Repository navigation
add nix support for tryx panorama manager - #33
Conversation
Promote experimental Flatpak support to production
Release 2.4.0: promote metadata and Flatpak assets
Release 2.5.1: Turris 620 media playback and Flatpak drag and drop
Release 2.5.2: Panorama WB, GPU badge names and Flatpak fixes
DXVSI
left a comment
There was a problem hiding this comment.
Thank you, Nix support is welcome. I moved the PR to development: changes land there first and reach production through a release PR.
I built your flake in a nixos/nix container with the locked nixpkgs. It builds, but a few things need to change before we can merge it.
1. Please drop .github/workflows/update.yml. The workflow exists because package.nix fetches this repository by tag and hash. A flake that lives in the repository should build its own source instead (src = lib.cleanSource ./., version read from VERSION); then every tag and branch builds itself and there is nothing to update. The workflow also does not fit how this repository works:
- it pushes to
productionevery 6 hours withcontents: write, while changes here go throughdevelopmentand a release PR; - pushes made with
GITHUB_TOKENdo not trigger our CI; - the bot can only write the new hash after the tag exists, so the tag itself always carries the previous version:
github:DXVSI/Tryx-Linux-GUI/v2.5.3would build 2.5.2.
We will add a nix build job to our own CI so the flake is checked on every PR.
2. package.nix drops most of the package. After make install it copies three files and removes $out/usr. Comparing the outputs:
- missing: the
tryxCLI, the udev rules, the man pages, the AppStream metainfo and the licenses. Without the udev rules the app cannot open the display on NixOS unless the user writes the rules by hand; - the icon comes from
find resources | head -n1, which pickedresources/devices/panorama-se.png, a photo of the device.make installalready installs the right icon, and our.desktopfile already hasExec=tryx-panorama-managerandIcon=tryx-panorama; tryx-panorama.protakes the user unit directory frompkg-config systemd, which points into the systemd store path, so the output also containsnix/store/…-systemd-261.3/lib/systemd/user/tryx-panorama.service.
3. Please keep our systemd unit. The hand-written unit loses settings the runtime relies on:
KillMode=mixedmakessystemctl stopsignal only the runtime, so it can finish anadborupgrade_toolfirmware write instead of having it killed halfway;TimeoutStopSec=20andNotifyAccess=mainkeep a stuck runtime from blocking logout while still letting a firmware write extend the timeout;- also
Type=dbuswithBusName=org.tryx.Panorama,PartOf=graphical-session.targetand the start limits.
Installing our unit and substituting the ExecStart path is enough. share/systemd/user is fine; nixpkgs moves user units there anyway.
4. ffmpeg at runtime. The runtime looks up ffmpeg and ffprobe through PATH. Having ffmpeg in buildInputs does not put it there, so media upload fails unless ffmpeg is installed system-wide. Wrapping the runtime with ffmpeg in PATH fixes it.
5. Smaller things.
CONFIG+=c++20is really needed: abseil in current nixpkgs fails under C++17 (std::partial_ordering). Oneqmakecall ontryx-panorama-all.propasses it to all subprojects, so the separateqmakeruns and the-stdsed are not needed.- The
lreleasepath can be set withQT_TOOL.lrelease.binary=…instead of editing the generated Makefiles. dbusis not needed: the app uses Qt D-Bus, not libdbus.flake.nixlacks a newline at the end.
Here is a package.nix that covers all of the above. It builds with your flake.nix and flake.lock unchanged, against the v2.5.2 source. I have only built it, not run it on NixOS with a display, so please test it on your machine:
package.nix
{
lib,
stdenv,
qt6,
protobuf,
libusb1,
systemd,
ffmpeg,
pkg-config,
}:
stdenv.mkDerivation {
pname = "tryx-panorama-manager";
version = lib.removeSuffix "\n" (builtins.readFile ./VERSION);
src = lib.cleanSource ./.;
nativeBuildInputs = [
qt6.qmake
qt6.qttools
qt6.wrapQtAppsHook
pkg-config
protobuf
];
buildInputs = [
qt6.qtbase
qt6.qtdeclarative
protobuf
libusb1
systemd
];
# systemd's pkg-config file points its unit directories into the systemd
# store path; install the unit and preset next to the rest of the package.
postPatch = ''
substituteInPlace tryx-panorama.pro \
--replace-fail '$$system(pkg-config --variable=systemduserunitdir systemd)' /usr/lib/systemd/user \
--replace-fail '$$system(pkg-config --variable=systemduserpresetdir systemd)' /usr/lib/systemd/user-preset
substituteInPlace systemd/tryx-panorama.service \
--replace-fail /usr/lib/tryx-panorama-manager/tryx-panorama-runtime \
$out/lib/tryx-panorama-manager/tryx-panorama-runtime
'';
# abseil in current nixpkgs needs C++20 (std::partial_ordering).
qmakeFlags = [
"tryx-panorama-all.pro"
"CONFIG+=c++20"
"QT_TOOL.lrelease.binary=${lib.getBin qt6.qttools}/bin/lrelease"
];
installFlags = [ "INSTALL_ROOT=$(out)" ];
postInstall = ''
cp -a $out/usr/. $out/
rm -r $out/usr
'';
# The runtime finds ffmpeg and ffprobe through PATH. wrapQtAppsHook only
# wraps bin/, and the runtime lives in lib/.
qtWrapperArgs = [ "--prefix PATH : ${lib.makeBinPath [ ffmpeg ]}" ];
postFixup = ''
wrapQtApp $out/lib/tryx-panorama-manager/tryx-panorama-runtime
'';
meta = {
description = "Qt6 GUI and runtime for TRYX Panorama cooler displays";
homepage = "https://github.com/DXVSI/Tryx-Linux-GUI";
license = lib.licenses.mit;
platforms = [ "x86_64-linux" ];
mainProgram = "tryx-panorama-manager";
};
}Its output has bin/tryx-panorama-manager, bin/tryx, the runtime in lib/tryx-panorama-manager/, lib/udev/rules.d/, our unit and preset, the icon, desktop file, metainfo, man pages and licenses.
Last thing: please describe in the PR how you enable it on NixOS (the udev rules and the user unit), so we can add a short NixOS section to the README.
Release 2.5.3: Panorama USB link and private runtime directories
|
okay i will work on it |
|
Applied the review: workflow removed, Enabling on NixOSThe udev rules are required, otherwise the app cannot open the display. # flake input
tryx.url = "github:DXVSI/Tryx-Linux-GUI";{
nixpkgs.overlays = [ inputs.tryx.overlays.default ];
environment.systemPackages = [ pkgs.tryx-panorama-manager ];
services.udev.packages = [ pkgs.tryx-panorama-manager ]; # udev rules
systemd.packages = [ pkgs.tryx-panorama-manager ]; # user unit
systemd.user.services.tryx-panorama.wantedBy = [ "graphical-session.target" ];
} |
DXVSI
left a comment
There was a problem hiding this comment.
Thank you, this looks good: the flake builds from the repository itself, keeps the full install with the udev rules and our unit, and wraps the runtime with ffmpeg. Thanks for testing it on NixOS with the display, and for the configuration snippet.
The failing Arch check is unrelated to this PR: Arch moved to Qt 6.12 today, and its qmllint flags five test QML files of ours. I will fix that separately, together with a NixOS section in the README based on your snippet and a nix build job in our CI.

hey i use a lot your software and i love it for my watercooling so i make a nix support if you want it it work simply with flake system and a workflow for auto update
you need to install it with inputs.tryx-panorama.packages.${pkgs.stdenv.hostPlatform.system}.default for it to work for setup the systemd service