Jump to content

Talk:Qt: Difference between revisions

From Official NixOS Wiki
Latest comment: 20 March 2025 by Turbotimon in topic whats about qt options?
 
Line 25: Line 25:


How can we update the file to have a working yet simple shell?
How can we update the file to have a working yet simple shell?
A similar flake.nix but with "qt5.full" expanded out
<syntaxHighlight lang=nix>
{
  inputs.nixpkgs.url = "github:nixos/nixpkgs";
  outputs =
    { self, nixpkgs }:
    let
      pkgs = nixpkgs.legacyPackages.x86_64-linux;
    in
    {
      devShells.x86_64-linux.default = pkgs.mkShell {
        buildInputs = with pkgs; [
          cmake
          gdb
          qt5.qt3d
          qt5.qtcharts
          qt5.qtconnectivity
          qt5.qtdatavis3d
          qt5.qtdeclarative
          qt5.qtdoc
          qt5.qtgamepad
          qt5.qtgraphicaleffects
          qt5.qtimageformats
          qt5.qtlocation
          qt5.qtlottie
          # if on MacOS qt5.qtmacextras
          qt5.qtmultimedia
          qt5.qtnetworkauth
          qt5.qtpim
          qt5.qtpositioning
          qt5.qtpurchasing
          qt5.qtquick1
          qt5.qtquick3d
          qt5.qtquickcontrols
          qt5.qtquickcontrols2
          qt5.qtremoteobjects
          qt5.qtscript
          qt5.qtsensors
          qt5.qtserialbus
          qt5.qtserialport
          qt5.qtspeech
          qt5.qtsvg
          qt5.qtsystems
          qt5.qtscxml
          qt5.qttools
          qt5.qttranslations
          qt5.qtvirtualkeyboard
          qt5.qtwayland
          qt5.qtwebchannel
          # Marked as insecure... qt5.qtwebengine
          qt5.qtwebglplugin
          # Marked as insecure... qt5.qtwebkit
          #qt5.qtwebsockets
          #qt5.qtwebview
          qt5.qtx11extras
          qt5.qtxmlpatterns
          qt5.qmake
          qtcreator
          # this is for the shellhook portion
          qt6.wrapQtAppsHook
          makeWrapper
          bashInteractive
        ];
        # set the environment variables that Qt apps expect
        shellHook = ''
          bashdir=$(mktemp -d)
          makeWrapper "$(type -p bash)" "$bashdir/bash" "''${qtWrapperArgs[@]}"
          exec "$bashdir/bash"
        '';
      };
    };
}
</syntaxHighlight>

Latest revision as of 16:35, 29 January 2026

whats about qt options?

I'm missing how the qt.enable nixos options plays a role in it? Would be a great addition too this wiki page! Turbotimon (talk) 07:47, 20 March 2025 (UTC)Reply

Basic Development shell fails, qt5.full was removed

The code presented as a basic development shell.nix:

# shell.nix
{ pkgs ? import <nixpkgs> {} }:
  pkgs.mkShell {
    buildInputs = [
      pkgs.qt5.full
      pkgs.qtcreator
    ];
}

It does not work, failing with the error:

error: libsForQt5.full has been removed. Please use individual packages instead.

How can we update the file to have a working yet simple shell?