{ description = "photogallery uploader — Qt6 C++ desktop app"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; flake-utils.url = "github:numtide/flake-utils"; }; outputs = { self, nixpkgs, flake-utils }: flake-utils.lib.eachDefaultSystem (system: let pkgs = import nixpkgs { inherit system; }; qtPlugins = pkgs.lib.makeSearchPathOutput "out" "lib/qt-6/plugins" [ pkgs.qt6.qtbase pkgs.qt6.qtwayland pkgs.qt6.qtimageformats ]; in { # Installable build: `nix profile install ./desktop` drops "Photog" into # the application menu with its icon. wrapQtAppsHook wraps the binary so # it finds the Qt platform (xcb + wayland) and image-format plugins on # its own, without the dev shell. packages.default = pkgs.stdenv.mkDerivation { pname = "photog"; version = "0.1.0"; src = ./.; nativeBuildInputs = with pkgs; [ cmake ninja pkg-config qt6.wrapQtAppsHook ]; buildInputs = with pkgs; [ qt6.qtbase qt6.qtwayland qt6.qtimageformats qt6Packages.qtkeychain ]; }; devShells.default = pkgs.mkShell { packages = with pkgs; [ cmake ninja pkg-config qt6.qtbase qt6.qtwayland # native Wayland QPA plugin qt6.qtimageformats # HEIF/HEIC + others, read by QImage qt6Packages.qtkeychain # password → libsecret / kwallet ]; shellHook = '' # Let a binary run straight from the build dir find Qt's platform # (xcb + wayland) and image-format plugins without wrapQtAppsHook. export QT_PLUGIN_PATH="${qtPlugins}''${QT_PLUGIN_PATH:+:$QT_PLUGIN_PATH}" ''; }; }); }