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?
<br /> [[User:Bernborgess|Bernborgess]] ([[User talk:Bernborgess|talk]]) 20:40, 28 January 2026 (UTC)


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

Revision as of 21:00, 28 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?

A similar flake.nix but with "qt5.full" expanded out

{
  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"
        '';
      };
    };
}