From 06fb97bc23f4e605f00d6c01dba9ab86d89425e5 Mon Sep 17 00:00:00 2001 From: Damocles Date: Mon, 20 Apr 2026 20:59:06 +0200 Subject: [PATCH] use unpatched qt for dev tooling (fmt, lint, devshell) --- flake.nix | 51 ++++++++++++++++------------ test/screen-uaf-reproducer/shell.nix | 11 ++++-- 2 files changed, 38 insertions(+), 24 deletions(-) diff --git a/flake.nix b/flake.nix index ea8a45d..5365927 100644 --- a/flake.nix +++ b/flake.nix @@ -55,8 +55,9 @@ nixpkgs.lib.genAttrs systems ( system: fn rec { - pkgs = (nixpkgs.legacyPackages.${system}).extend qtbaseOverlay; - treefmt-eval = treefmt-nix.lib.evalModule pkgs treefmt-config; + rawPkgs = nixpkgs.legacyPackages.${system}; + pkgs = rawPkgs.extend qtbaseOverlay; + treefmt-eval = treefmt-nix.lib.evalModule rawPkgs treefmt-config; } ); in @@ -64,7 +65,7 @@ formatter = forAllSystems ({ treefmt-eval, ... }: treefmt-eval.config.build.wrapper); packages = forAllSystems ( - { pkgs, ... }: + { pkgs, rawPkgs, ... }: let # Rebuild quickshell against patched Qt via its overlay qs = (pkgs.extend quickshell.overlays.default).quickshell.override { @@ -94,28 +95,30 @@ pname = "screen-uaf-reproducer-patched"; version = "0"; src = ./test/screen-uaf-reproducer; - nativeBuildInputs = [ pkgs.cmake pkgs.qt6.wrapQtAppsHook ]; + nativeBuildInputs = [ + pkgs.cmake + pkgs.qt6.wrapQtAppsHook + ]; buildInputs = [ pkgs.qt6.qtbase ]; }; - screen-uaf-reproducer-unpatched = - let - rawPkgs = nixpkgs.legacyPackages.${pkgs.stdenv.hostPlatform.system}; - in - rawPkgs.stdenv.mkDerivation { - pname = "screen-uaf-reproducer-unpatched"; - version = "0"; - src = ./test/screen-uaf-reproducer; - nativeBuildInputs = [ rawPkgs.cmake rawPkgs.qt6.wrapQtAppsHook ]; - buildInputs = [ rawPkgs.qt6.qtbase ]; - }; + screen-uaf-reproducer-unpatched = rawPkgs.stdenv.mkDerivation { + pname = "screen-uaf-reproducer-unpatched"; + version = "0"; + src = ./test/screen-uaf-reproducer; + nativeBuildInputs = [ + rawPkgs.cmake + rawPkgs.qt6.wrapQtAppsHook + ]; + buildInputs = [ rawPkgs.qt6.qtbase ]; + }; } ); devShells = forAllSystems ( - { pkgs, ... }: + { rawPkgs, ... }: { - default = pkgs.mkShell { - packages = with pkgs; [ + default = rawPkgs.mkShell { + packages = with rawPkgs; [ cargo rustc rust-analyzer @@ -129,21 +132,25 @@ ); checks = forAllSystems ( - { pkgs, treefmt-eval }: + { + pkgs, + rawPkgs, + treefmt-eval, + }: { formatting = treefmt-eval.config.build.check self; build = self.packages.${pkgs.stdenv.hostPlatform.system}.default; nova-stats = self.packages.${pkgs.stdenv.hostPlatform.system}.nova-stats; docs = self.packages.${pkgs.stdenv.hostPlatform.system}.docs; qmllint = - pkgs.runCommand "nova-shell-qmllint" + rawPkgs.runCommand "nova-shell-qmllint" { - nativeBuildInputs = [ pkgs.qt6.qtdeclarative ]; + nativeBuildInputs = [ rawPkgs.qt6.qtdeclarative ]; src = self; } '' cd $src - export QML_IMPORT_PATH="${pkgs.qt6.qtdeclarative}/lib/qt-6/qml:${ + export QML_IMPORT_PATH="${rawPkgs.qt6.qtdeclarative}/lib/qt-6/qml:${ quickshell.packages.${pkgs.stdenv.hostPlatform.system}.default }/lib/qt-6/qml" qmllint -E \ diff --git a/test/screen-uaf-reproducer/shell.nix b/test/screen-uaf-reproducer/shell.nix index aa50db7..0c6fd61 100644 --- a/test/screen-uaf-reproducer/shell.nix +++ b/test/screen-uaf-reproducer/shell.nix @@ -1,4 +1,11 @@ -{ pkgs ? import {} }: +{ + pkgs ? import { }, +}: pkgs.mkShell { - nativeBuildInputs = with pkgs; [ cmake qt6.qtbase qt6.wrapQtAppsHook wlr-randr ]; + nativeBuildInputs = with pkgs; [ + cmake + qt6.qtbase + qt6.wrapQtAppsHook + wlr-randr + ]; }