diff options
| author | afix.space <laurent@afix.space> | 2026-07-09 19:34:22 +0200 |
|---|---|---|
| committer | afix.space <laurent@afix.space> | 2026-07-09 19:34:22 +0200 |
| commit | 5c369a5d98dbab80903dfcb7c52625c78228e789 (patch) | |
| tree | e17ac19cc282778dd14aa6cdac3b50481e55e9ea /flake.nix | |
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.
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 45 |
1 files changed, 45 insertions, 0 deletions
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" + ''; + }; + }; +} |
