From 5c369a5d98dbab80903dfcb7c52625c78228e789 Mon Sep 17 00:00:00 2001 From: "afix.space" Date: Thu, 9 Jul 2026 19:34:22 +0200 Subject: feat: PySide6 dev environment with runnable examples MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Flake devShell (PySide6 6.11 on Python 3.13, designer, uic/rcc from qtbase libexec, offline docs) plus hello_widgets and hello_quick examples. QML_IMPORT_PATH exported — nixpkgs PySide6 finds platform plugins on its own but not QML imports; see README. --- flake.nix | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 flake.nix (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..40e09a0 --- /dev/null +++ b/flake.nix @@ -0,0 +1,45 @@ +{ + description = "Qt for Python development environment (PySide6, nixos-26.05)"; + + inputs = { + nixpkgs.url = "github:Nixos/nixpkgs/nixos-26.05"; + }; + + outputs = + { self, nixpkgs }: + let + system = "x86_64-linux"; + pkgs = nixpkgs.legacyPackages.${system}; + + python = pkgs.python3.withPackages ( + p: with p; [ + pyside6 + ] + ); + in + { + formatter.${system} = pkgs.nixfmt; + + devShells.${system}.default = pkgs.mkShell { + packages = [ + python + pkgs.qt6.qttools # designer, linguist, assistant + pkgs.qt6.qtdoc # offline documentation for Assistant + ]; + + # Platform plugins are found automatically (compiled-in store + # paths), but QML imports are NOT: without this export, any + # "import QtQuick" fails with "module is not installed". + shellHook = '' + # uic/rcc (with Python codegen via -g python) live in libexec, + # not bin, so they are not on PATH by default. + export PATH=${pkgs.qt6.qtbase}/libexec:$PATH + export QML_IMPORT_PATH=${pkgs.qt6.qtdeclarative}/lib/qt-6/qml + export QML2_IMPORT_PATH=$QML_IMPORT_PATH + export QT_DOCS=${pkgs.qt6.qtdoc}/share/doc + echo "PySide6 $(python -c 'import PySide6; print(PySide6.__version__)') sur Python $(python -V | cut -d' ' -f2)" + echo "Exemples dans ./examples — voir README.md" + ''; + }; + }; +} -- cgit v1.3.1