Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 23 additions & 12 deletions doc/languages-frameworks/qt.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,32 +92,43 @@ mkDerivation {
}
```
## Adding a library to Nixpkgs
Add a Qt library to all-packages.nix by adding it to the collection inside `mkLibsForQt5`. This ensures that the library is built with every available version of Qt as needed.

### Example Adding a Qt library to all-packages.nix {#qt-library-all-packages-nix}
Qt libraries are added to `qt5-packages.nix` and are made available for every Qt
version supported.
### Example adding a Qt library {#qt-library-all-packages-nix}

The following represents the contents of `qt5-packages.nix`.
```
{
# ...

mkLibsForQt5 = self: with self; {
# ...

mylib = callPackage ../path/to/mylib {};
};
mylib = callPackage ../path/to/mylib {};

# ...
}
```
## Adding an application to Nixpkgs
Add a Qt application to *all-packages.nix* using `libsForQt5.callPackage` instead of the usual `callPackage`. The former ensures that all dependencies are built with the same version of Qt.
Applications that use Qt are also added to `qt5-packages.nix`. An alias is added
in the top-level `all-packages.nix` pointing to the package with the desired Qt5 version.

### Example Adding a QT application to all-packages.nix {#qt-application-all-packages-nix}
```nix
### Example adding a Qt application {#qt-application-all-packages-nix}

The following represents the contents of `qt5-packages.nix`.
```
{
# ...

myapp = callPackage ../path/to/myapp {};

# ...
}
```

The following represents the contents of `all-packages.nix`.
```
{
# ...

myapp = libsForQt5.callPackage ../path/to/myapp/ {};
myapp = libsForQt5.myapp;

# ...
}
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/i18n/input-method/ibus.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ in
panel = mkOption {
type = with types; nullOr path;
default = null;
example = literalExample "''${pkgs.plasma5.plasma-desktop}/lib/libexec/kimpanel-ibus-panel";
example = literalExample "''${pkgs.plasma5Packages.plasma-desktop}/lib/libexec/kimpanel-ibus-panel";
description = "Replace the IBus panel with another panel.";
};
};
Expand Down
8 changes: 4 additions & 4 deletions nixos/modules/security/pam.nix
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,8 @@ let
${optionalString cfg.pamMount
"auth optional ${pkgs.pam_mount}/lib/security/pam_mount.so"}
${optionalString cfg.enableKwallet
("auth optional ${pkgs.plasma5.kwallet-pam}/lib/security/pam_kwallet5.so" +
" kwalletd=${pkgs.kdeFrameworks.kwallet.bin}/bin/kwalletd5")}
("auth optional ${pkgs.plasma5Packages.kwallet-pam}/lib/security/pam_kwallet5.so" +
" kwalletd=${pkgs.plasma5Packages.kwallet.bin}/bin/kwalletd5")}
${optionalString cfg.enableGnomeKeyring
"auth optional ${pkgs.gnome3.gnome-keyring}/lib/security/pam_gnome_keyring.so"}
${optionalString cfg.gnupg.enable
Expand Down Expand Up @@ -509,8 +509,8 @@ let
${optionalString (cfg.enableAppArmor && config.security.apparmor.enable)
"session optional ${pkgs.apparmor-pam}/lib/security/pam_apparmor.so order=user,group,default debug"}
${optionalString (cfg.enableKwallet)
("session optional ${pkgs.plasma5.kwallet-pam}/lib/security/pam_kwallet5.so" +
" kwalletd=${pkgs.kdeFrameworks.kwallet.bin}/bin/kwalletd5")}
("session optional ${pkgs.plasma5Packages.kwallet-pam}/lib/security/pam_kwallet5.so" +
" kwalletd=${pkgs.plasma5Packages.kwallet.bin}/bin/kwalletd5")}
${optionalString (cfg.enableGnomeKeyring)
"session optional ${pkgs.gnome3.gnome-keyring}/lib/security/pam_gnome_keyring.so auto_start"}
${optionalString cfg.gnupg.enable
Expand Down
10 changes: 5 additions & 5 deletions nixos/modules/services/x11/desktop-managers/plasma5.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ let
xcfg = config.services.xserver;
cfg = xcfg.desktopManager.plasma5;

inherit (pkgs) kdeApplications kdeFrameworks plasma5;
inherit (pkgs) qt5 libsForQt5;
libsForQt5 = pkgs.plasma5Packages;
inherit (libsForQt5) kdeApplications kdeFrameworks plasma5;
inherit (pkgs) writeText;

pulseaudio = config.hardware.pulseaudio;
Expand Down Expand Up @@ -198,8 +198,8 @@ in
};

security.wrappers = {
kcheckpass.source = "${lib.getBin plasma5.kscreenlocker}/libexec/kcheckpass";
start_kdeinit.source = "${lib.getBin pkgs.kdeFrameworks.kinit}/libexec/kf5/start_kdeinit";
kcheckpass.source = "${lib.getBin libsForQt5.kscreenlocker}/libexec/kcheckpass";
start_kdeinit.source = "${lib.getBin libsForQt5.kinit}/libexec/kf5/start_kdeinit";
kwin_wayland = {
source = "${lib.getBin plasma5.kwin}/bin/kwin_wayland";
capabilities = "cap_sys_nice+ep";
Expand All @@ -213,7 +213,7 @@ in
'';

environment.systemPackages =
with qt5; with libsForQt5;
with libsForQt5;
with plasma5; with kdeApplications; with kdeFrameworks;
[
frameworkintegration
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/system/boot/plymouth.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ let

cfg = config.boot.plymouth;

nixosBreezePlymouth = pkgs.plasma5.breeze-plymouth.override {
nixosBreezePlymouth = pkgs.plasma5Packages.breeze-plymouth.override {
logoFile = cfg.logo;
logoName = "nixos";
osName = "NixOS";
Expand Down
4 changes: 2 additions & 2 deletions pkgs/applications/networking/browsers/firefox/wrapper.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
, flashplayer, hal-flash
, ffmpeg, xorg, alsaLib, libpulseaudio, libcanberra-gtk2, libglvnd
, gnome3/*.gnome-shell*/
, browserpass, chrome-gnome-shell, uget-integrator, plasma5, bukubrow
, browserpass, chrome-gnome-shell, uget-integrator, plasma5Packages, bukubrow
, tridactyl-native
, fx_cast_bridge
, udev
Expand Down Expand Up @@ -76,7 +76,7 @@ let
++ lib.optional (cfg.enableTridactylNative or false) tridactyl-native
++ lib.optional (cfg.enableGnomeExtensions or false) chrome-gnome-shell
++ lib.optional (cfg.enableUgetIntegrator or false) uget-integrator
++ lib.optional (cfg.enablePlasmaBrowserIntegration or false) plasma5.plasma-browser-integration
++ lib.optional (cfg.enablePlasmaBrowserIntegration or false) plasma5Packages.plasma-browser-integration
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't directly related to this pull request, but would it be better to import plasma-browser-integration directly, and inherit it from plasma5Packages in all-packages.nix?

++ lib.optional (cfg.enableFXCastBridge or false) fx_cast_bridge
++ extraNativeMessagingHosts
);
Expand Down
10 changes: 5 additions & 5 deletions pkgs/top-level/aliases.nix
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ mapAliases ({
k9copy = throw "k9copy has been removed from nixpkgs, as there is no upstream activity"; # 2020-11-06
julia_07 = throw "julia_07 is deprecated in favor of julia_10 LTS"; # added 2020-09-15
julia_11 = throw "julia_11 is deprecated in favor of latest Julia version"; # added 2020-09-15
kdeconnect = kdeApplications.kdeconnect-kde; # added 2020-10-28
kdeconnect = plasma5Packages.kdeconnect-kde; # added 2020-10-28
kdiff3-qt5 = kdiff3; # added 2017-02-18
keepass-keefox = keepass-keepassrpc; # backwards compatibility alias, added 2018-02
keepassx-community = keepassxc; # added 2017-11
Expand Down Expand Up @@ -808,8 +808,8 @@ mapAliases ({
between mixed versions of qt. See:
https://github.com/NixOS/nixpkgs/pull/101369 */

inherit (kdeFrameworks) breeze-icons oxygen-icons5;
inherit (kdeApplications)
inherit (plasma5Packages) breeze-icons oxygen-icons5;
inherit (plasma5Packages)
akonadi akregator ark
bomber bovo
dolphin dragon
Expand Down Expand Up @@ -841,7 +841,7 @@ mapAliases ({
spectacle
yakuake
;
inherit (plasma5)
inherit (plasma5Packages)
bluedevil breeze-gtk breeze-qt5 breeze-grub breeze-plymouth discover
kactivitymanagerd kde-cli-tools kde-gtk-config kdeplasma-addons kgamma5
kinfocenter kmenuedit kscreen kscreenlocker ksshaskpass ksysguard
Expand All @@ -850,7 +850,7 @@ mapAliases ({
plasma-workspace-wallpapers polkit-kde-agent powerdevil sddm-kcm
systemsettings xdg-desktop-portal-kde
;
inherit (plasma5.thirdParty)
inherit (plasma5Packages.thirdParty)
plasma-applet-caffeine-plus
kwin-dynamic-workspaces
kwin-tiling
Expand Down
Loading