From e503eabd00072bef9d90423414775ed8ee95ae86 Mon Sep 17 00:00:00 2001 From: Yuna404 Date: Mon, 5 Oct 2026 19:25:12 +0200 Subject: [PATCH 1/4] Initial flake for Tryx Panorama Manager 2.5.2 --- .github/workflows/update.yml | 43 ++++++++++ flake.lock | 27 ++++++ flake.nix | 29 +++++++ package.nix | 159 +++++++++++++++++++++++++++++++++++ 4 files changed, 258 insertions(+) create mode 100644 .github/workflows/update.yml create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 package.nix diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml new file mode 100644 index 0000000..6151efa --- /dev/null +++ b/.github/workflows/update.yml @@ -0,0 +1,43 @@ +name: Update Tryx Panorama Manager + +on: + schedule: + - cron: "0 */6 * * *" + workflow_dispatch: + +permissions: + contents: write + +jobs: + update: + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v5 + + - uses: cachix/install-nix-action@v31 + with: + extra_nix_config: | + experimental-features = nix-command flakes + + - name: Check for a new release + id: update + run: | + nix run nixpkgs#nix-update -- --flake tryx-panorama-manager --version-regex 'v(.*)' + if git diff --quiet; then + echo "changed=false" >> "$GITHUB_OUTPUT" + else + echo "changed=true" >> "$GITHUB_OUTPUT" + fi + + - name: Build the new version + if: steps.update.outputs.changed == 'true' + run: nix build .#tryx-panorama-manager --print-build-logs + + - name: Commit and push + if: steps.update.outputs.changed == 'true' + run: | + version=$(nix eval --raw .#tryx-panorama-manager.version) + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git commit -am "tryx-panorama-manager: update to ${version}" + git push diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..4b67419 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1791048980, + "narHash": "sha256-KgItSKML8Xvte0B7/uGnBDsYzSnnKHcOaiUbgWBXLXw=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "a7868a727837f3c09cee2ce0ca671c76b1589fed", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..54a9e7d --- /dev/null +++ b/flake.nix @@ -0,0 +1,29 @@ +{ + description = "Qt6/C++ GUI for TRYX display control on NixOS"; + + inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; + + outputs = + { self, nixpkgs }: + let + system = "x86_64-linux"; + pkgs = import nixpkgs { + inherit system; + }; + in + { + packages.${system} = rec { + tryx-panorama-manager = pkgs.callPackage ./package.nix { }; + default = tryx-panorama-manager; + }; + + apps.${system}.default = { + type = "app"; + program = "${self.packages.${system}.default}/bin/tryx-panorama-manager"; + }; + + overlays.default = final: prev: { + tryx-panorama-manager = final.callPackage ./package.nix { }; + }; + }; +} \ No newline at end of file diff --git a/package.nix b/package.nix new file mode 100644 index 0000000..0ef3f0c --- /dev/null +++ b/package.nix @@ -0,0 +1,159 @@ +{ + lib, + stdenv, + fetchFromGitHub, + qt6, + protobuf, + libusb1, + systemd, + ffmpeg, + dbus, + pkg-config, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "tryx-panorama-manager"; + version = "2.5.2"; + + src = fetchFromGitHub { + owner = "DXVSI"; + repo = "Tryx-Linux-GUI"; + tag = "v${finalAttrs.version}"; + hash = "sha256-8n9GUB7yZeK5TKcaYu8xmIfoEoaAt5tPhxadNHeR+iM="; + }; + + nativeBuildInputs = [ + qt6.wrapQtAppsHook + qt6.qmake + qt6.qttools + pkg-config + protobuf + ]; + + buildInputs = [ + qt6.qtbase + qt6.qtdeclarative + libusb1 + systemd + ffmpeg + dbus + protobuf + ]; + + configurePhase = '' + runHook preConfigure + + qmake6 CONFIG+=c++20 tryx-panorama-all.pro + + qmake6 \ + CONFIG+=c++20 \ + -o Makefile.runtime \ + tryx-panorama.pro + + qmake6 \ + CONFIG+=c++20 \ + -o Makefile.quick \ + tryx-panorama-quick.pro + + sed -i \ + -e "s|${qt6.qtbase}/bin/lrelease|${qt6.qttools}/bin/lrelease|g" \ + -e 's/-std=gnu++1z/-std=gnu++20/g' \ + Makefile.runtime Makefile.quick + + runHook postConfigure + ''; + + buildPhase = '' + runHook preBuild + + make -j$NIX_BUILD_CORES + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + make INSTALL_ROOT="$out" install + + mkdir -p "$out/bin" + mkdir -p "$out/lib/tryx-panorama-manager" + mkdir -p "$out/share/applications" + mkdir -p "$out/share/icons/hicolor/512x512/apps" + mkdir -p "$out/share/systemd/user" + + if [ -f "$out/usr/bin/tryx-panorama-manager" ]; then + install -Dm755 \ + "$out/usr/bin/tryx-panorama-manager" \ + "$out/bin/tryx-panorama-manager" + fi + + if [ -f "$out/usr/lib/tryx-panorama-manager/tryx-panorama-runtime" ]; then + install -Dm755 \ + "$out/usr/lib/tryx-panorama-manager/tryx-panorama-runtime" \ + "$out/lib/tryx-panorama-manager/tryx-panorama-runtime" + fi + + if [ -f "$out/usr/share/applications/tryx-panorama-manager.desktop" ]; then + install -Dm644 \ + "$out/usr/share/applications/tryx-panorama-manager.desktop" \ + "$out/share/applications/tryx-panorama-manager.desktop" + fi + + icon_file=$( + find "$src/resources" -type f \ + \( -iname '*.png' -o -iname '*.svg' \) \ + | head -n1 + ) + + if [ -n "$icon_file" ]; then + case "$icon_file" in + *.png) + install -Dm644 \ + "$icon_file" \ + "$out/share/icons/hicolor/512x512/apps/tryx-panorama-manager.png" + ;; + *.svg) + mkdir -p "$out/share/icons/hicolor/scalable/apps" + install -Dm644 \ + "$icon_file" \ + "$out/share/icons/hicolor/scalable/apps/tryx-panorama-manager.svg" + ;; + esac + fi + + if [ -f "$out/share/applications/tryx-panorama-manager.desktop" ]; then + sed -i \ + -e 's|^Exec=.*|Exec=tryx-panorama-manager|' \ + -e 's|^Icon=.*|Icon=tryx-panorama-manager|' \ + "$out/share/applications/tryx-panorama-manager.desktop" + fi + + cat > "$out/share/systemd/user/tryx-panorama.service" < Date: Wed, 7 Oct 2026 21:31:27 +0200 Subject: [PATCH 2/4] Delete .github/workflows/update.yml --- .github/workflows/update.yml | 43 ------------------------------------ 1 file changed, 43 deletions(-) delete mode 100644 .github/workflows/update.yml diff --git a/.github/workflows/update.yml b/.github/workflows/update.yml deleted file mode 100644 index 6151efa..0000000 --- a/.github/workflows/update.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Update Tryx Panorama Manager - -on: - schedule: - - cron: "0 */6 * * *" - workflow_dispatch: - -permissions: - contents: write - -jobs: - update: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v5 - - - uses: cachix/install-nix-action@v31 - with: - extra_nix_config: | - experimental-features = nix-command flakes - - - name: Check for a new release - id: update - run: | - nix run nixpkgs#nix-update -- --flake tryx-panorama-manager --version-regex 'v(.*)' - if git diff --quiet; then - echo "changed=false" >> "$GITHUB_OUTPUT" - else - echo "changed=true" >> "$GITHUB_OUTPUT" - fi - - - name: Build the new version - if: steps.update.outputs.changed == 'true' - run: nix build .#tryx-panorama-manager --print-build-logs - - - name: Commit and push - if: steps.update.outputs.changed == 'true' - run: | - version=$(nix eval --raw .#tryx-panorama-manager.version) - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git commit -am "tryx-panorama-manager: update to ${version}" - git push From f4daf7fff375ec22a176b6e1efe0f62c96625b2e Mon Sep 17 00:00:00 2001 From: Yuna <168458124+Yuna404@users.noreply.github.com> Date: Wed, 7 Oct 2026 21:31:53 +0200 Subject: [PATCH 3/4] Update flake.nix --- flake.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 54a9e7d..2fff04b 100644 --- a/flake.nix +++ b/flake.nix @@ -26,4 +26,4 @@ tryx-panorama-manager = final.callPackage ./package.nix { }; }; }; -} \ No newline at end of file +} From f7855cf739ce877aab433907c303461ceefd936a Mon Sep 17 00:00:00 2001 From: Yuna <168458124+Yuna404@users.noreply.github.com> Date: Wed, 7 Oct 2026 21:32:37 +0200 Subject: [PATCH 4/4] update package.nix --- package.nix | 145 ++++++++++------------------------------------------ 1 file changed, 27 insertions(+), 118 deletions(-) diff --git a/package.nix b/package.nix index 0ef3f0c..fa23b1a 100644 --- a/package.nix +++ b/package.nix @@ -1,31 +1,24 @@ { lib, stdenv, - fetchFromGitHub, qt6, protobuf, libusb1, systemd, ffmpeg, - dbus, pkg-config, }: -stdenv.mkDerivation (finalAttrs: { +stdenv.mkDerivation { pname = "tryx-panorama-manager"; - version = "2.5.2"; + version = lib.removeSuffix "\n" (builtins.readFile ./VERSION); - src = fetchFromGitHub { - owner = "DXVSI"; - repo = "Tryx-Linux-GUI"; - tag = "v${finalAttrs.version}"; - hash = "sha256-8n9GUB7yZeK5TKcaYu8xmIfoEoaAt5tPhxadNHeR+iM="; - }; + src = lib.cleanSource ./.; nativeBuildInputs = [ - qt6.wrapQtAppsHook qt6.qmake qt6.qttools + qt6.wrapQtAppsHook pkg-config protobuf ]; @@ -33,127 +26,43 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ qt6.qtbase qt6.qtdeclarative + protobuf libusb1 systemd - ffmpeg - dbus - protobuf ]; - configurePhase = '' - runHook preConfigure - - qmake6 CONFIG+=c++20 tryx-panorama-all.pro - - qmake6 \ - CONFIG+=c++20 \ - -o Makefile.runtime \ - tryx-panorama.pro - - qmake6 \ - CONFIG+=c++20 \ - -o Makefile.quick \ - tryx-panorama-quick.pro - - sed -i \ - -e "s|${qt6.qtbase}/bin/lrelease|${qt6.qttools}/bin/lrelease|g" \ - -e 's/-std=gnu++1z/-std=gnu++20/g' \ - Makefile.runtime Makefile.quick - - runHook postConfigure + 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 ''; - buildPhase = '' - runHook preBuild + qmakeFlags = [ + "tryx-panorama-all.pro" + "CONFIG+=c++20" + "QT_TOOL.lrelease.binary=${lib.getBin qt6.qttools}/bin/lrelease" + ]; - make -j$NIX_BUILD_CORES + installFlags = [ "INSTALL_ROOT=$(out)" ]; - runHook postBuild + postInstall = '' + cp -a $out/usr/. $out/ + rm -r $out/usr ''; - installPhase = '' - runHook preInstall - - make INSTALL_ROOT="$out" install - - mkdir -p "$out/bin" - mkdir -p "$out/lib/tryx-panorama-manager" - mkdir -p "$out/share/applications" - mkdir -p "$out/share/icons/hicolor/512x512/apps" - mkdir -p "$out/share/systemd/user" - - if [ -f "$out/usr/bin/tryx-panorama-manager" ]; then - install -Dm755 \ - "$out/usr/bin/tryx-panorama-manager" \ - "$out/bin/tryx-panorama-manager" - fi - - if [ -f "$out/usr/lib/tryx-panorama-manager/tryx-panorama-runtime" ]; then - install -Dm755 \ - "$out/usr/lib/tryx-panorama-manager/tryx-panorama-runtime" \ - "$out/lib/tryx-panorama-manager/tryx-panorama-runtime" - fi - - if [ -f "$out/usr/share/applications/tryx-panorama-manager.desktop" ]; then - install -Dm644 \ - "$out/usr/share/applications/tryx-panorama-manager.desktop" \ - "$out/share/applications/tryx-panorama-manager.desktop" - fi - - icon_file=$( - find "$src/resources" -type f \ - \( -iname '*.png' -o -iname '*.svg' \) \ - | head -n1 - ) - - if [ -n "$icon_file" ]; then - case "$icon_file" in - *.png) - install -Dm644 \ - "$icon_file" \ - "$out/share/icons/hicolor/512x512/apps/tryx-panorama-manager.png" - ;; - *.svg) - mkdir -p "$out/share/icons/hicolor/scalable/apps" - install -Dm644 \ - "$icon_file" \ - "$out/share/icons/hicolor/scalable/apps/tryx-panorama-manager.svg" - ;; - esac - fi - - if [ -f "$out/share/applications/tryx-panorama-manager.desktop" ]; then - sed -i \ - -e 's|^Exec=.*|Exec=tryx-panorama-manager|' \ - -e 's|^Icon=.*|Icon=tryx-panorama-manager|' \ - "$out/share/applications/tryx-panorama-manager.desktop" - fi - - cat > "$out/share/systemd/user/tryx-panorama.service" <