Skip to content

add nix support for tryx panorama manager - #33

Merged
DXVSI merged 11 commits into
DXVSI:developmentfrom
Yuna404:main
Oct 8, 2026
Merged

DXVSI merged 11 commits into
DXVSI:developmentfrom
Yuna404:main

Conversation

@Yuna404

@Yuna404 Yuna404 commented Oct 5, 2026 •

Copy link
Copy Markdown

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

DXVSI and others added 6 commits September 15, 2026 02:21
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
@Yuna404 Yuna404 closed this Oct 5, 2026
@Yuna404 Yuna404 reopened this Oct 5, 2026
@DXVSI
DXVSI changed the base branch from production to development October 7, 2026 00:24

@DXVSI DXVSI left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 production every 6 hours with contents: write, while changes here go through development and a release PR;
  • pushes made with GITHUB_TOKEN do 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.3 would 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 tryx CLI, 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 picked resources/devices/panorama-se.png, a photo of the device. make install already installs the right icon, and our .desktop file already has Exec=tryx-panorama-manager and Icon=tryx-panorama;
  • tryx-panorama.pro takes the user unit directory from pkg-config systemd, which points into the systemd store path, so the output also contains nix/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=mixed makes systemctl stop signal only the runtime, so it can finish an adb or upgrade_tool firmware write instead of having it killed halfway;
  • TimeoutStopSec=20 and NotifyAccess=main keep a stuck runtime from blocking logout while still letting a firmware write extend the timeout;
  • also Type=dbus with BusName=org.tryx.Panorama, PartOf=graphical-session.target and 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++20 is really needed: abseil in current nixpkgs fails under C++17 (std::partial_ordering). One qmake call on tryx-panorama-all.pro passes it to all subprojects, so the separate qmake runs and the -std sed are not needed.
  • The lrelease path can be set with QT_TOOL.lrelease.binary=… instead of editing the generated Makefiles.
  • dbus is not needed: the app uses Qt D-Bus, not libdbus.
  • flake.nix lacks 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
@Yuna404

Yuna404 commented Oct 7, 2026

Copy link
Copy Markdown
Author

okay i will work on it

@Yuna404

Yuna404 commented Oct 7, 2026 •

Copy link
Copy Markdown
Author

Applied the review: workflow removed, package.nix replaced with the suggested version, newline added to flake.nix. nix build . works and the output contains tryx, the udev rules and the user unit. Tested on NixOS with the display connected: the app detects it and works.

Enabling on NixOS

The 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" ];
}

IMG_20261007_221024.jpg

@DXVSI DXVSI left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@DXVSI
DXVSI merged commit f7a124f into DXVSI:development Oct 8, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants