From b368c0dcca399ed01732a965965962c6df5d9223 Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Mon, 22 Mar 2021 20:50:59 -0400 Subject: [PATCH 01/12] plasma-settings: init at 21.08 --- pkgs/applications/plasma-mobile/default.nix | 1 + .../plasma-mobile/plasma-settings.nix | 42 +++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 pkgs/applications/plasma-mobile/plasma-settings.nix diff --git a/pkgs/applications/plasma-mobile/default.nix b/pkgs/applications/plasma-mobile/default.nix index fd9ae2a2bae84..10c1f1d0e9bc8 100644 --- a/pkgs/applications/plasma-mobile/default.nix +++ b/pkgs/applications/plasma-mobile/default.nix @@ -75,6 +75,7 @@ let kweather = callPackage ./kweather.nix {}; plasma-dialer = callPackage ./plasma-dialer.nix {}; plasma-phonebook = callPackage ./plasma-phonebook.nix {}; + plasma-settings = callPackage ./plasma-settings.nix {}; spacebar = callPackage ./spacebar.nix {}; }; diff --git a/pkgs/applications/plasma-mobile/plasma-settings.nix b/pkgs/applications/plasma-mobile/plasma-settings.nix new file mode 100644 index 0000000000000..bcd04dadca22c --- /dev/null +++ b/pkgs/applications/plasma-mobile/plasma-settings.nix @@ -0,0 +1,42 @@ +{ lib +, mkDerivation +, fetchFromGitLab + +, cmake +, extra-cmake-modules + +, kauth +, kconfig +, kcoreaddons +, kdbusaddons +, ki18n +, kitemmodels +, plasma-framework +}: + +mkDerivation rec { + pname = "plasma-settings"; + + nativeBuildInputs = [ + cmake + extra-cmake-modules + ]; + + buildInputs = [ + kauth + kconfig + kcoreaddons + kdbusaddons + ki18n + kitemmodels + plasma-framework + ]; + + meta = with lib; { + description = "Settings application for Plasma Mobile"; + homepage = "https://invent.kde.org/plasma-mobile/plasma-settings"; + # https://invent.kde.org/plasma-mobile/plasma-settings/-/commit/a59007f383308503e59498b3036e1483bca26e35 + license = licenses.gpl2Plus; + maintainers = with maintainers; [ samueldr ]; + }; +} From 3ed0e42e0f8ec3ee78ea4e22b3722335459ea675 Mon Sep 17 00:00:00 2001 From: Tyler Slabinski Date: Tue, 26 Mar 2019 10:35:33 -0400 Subject: [PATCH 02/12] plasma-phone-components: Init at 5.23.3 --- pkgs/desktops/plasma-5/default.nix | 1 + .../plasma-phone-components/default.nix | 43 +++++++++++++++++++ pkgs/top-level/aliases.nix | 1 + 3 files changed, 45 insertions(+) create mode 100644 pkgs/desktops/plasma-5/plasma-phone-components/default.nix diff --git a/pkgs/desktops/plasma-5/default.nix b/pkgs/desktops/plasma-5/default.nix index 8abf2b37dbeca..7bcd4ca0d2544 100644 --- a/pkgs/desktops/plasma-5/default.nix +++ b/pkgs/desktops/plasma-5/default.nix @@ -134,6 +134,7 @@ let milou = callPackage ./milou.nix {}; oxygen = callPackage ./oxygen.nix {}; plasma-browser-integration = callPackage ./plasma-browser-integration.nix {}; + plasma-phone-components = callPackage ./plasma-phone-components {}; plasma-desktop = callPackage ./plasma-desktop {}; plasma-disks = callPackage ./plasma-disks.nix {}; plasma-integration = callPackage ./plasma-integration {}; diff --git a/pkgs/desktops/plasma-5/plasma-phone-components/default.nix b/pkgs/desktops/plasma-5/plasma-phone-components/default.nix new file mode 100644 index 0000000000000..d925d7e408b51 --- /dev/null +++ b/pkgs/desktops/plasma-5/plasma-phone-components/default.nix @@ -0,0 +1,43 @@ +{ + mkDerivation, lib, + + extra-cmake-modules, kdoctools, + + coreutils, dbus, gnugrep, gnused, libdbusmenu, pam, wayland, appstream, + + kdeclarative, kdelibs4support, kpeople, kconfig, krunner, kinit, kwayland, kwin, + plasma-framework, telepathy, libphonenumber, protobuf, libqofono, modemmanager-qt, + plasma-workspace, + maliit-framework, maliit-keyboard, + + qtwayland, qttools +}: + +let inherit (lib) getBin getLib; in + +mkDerivation { + name = "plasma-phone-components"; + + nativeBuildInputs = [ extra-cmake-modules kdoctools ]; + buildInputs = [ + appstream libdbusmenu pam wayland + kdeclarative kdelibs4support kpeople kconfig krunner kinit kwayland kwin + plasma-framework telepathy libphonenumber protobuf libqofono modemmanager-qt + maliit-framework maliit-keyboard + ]; + + postPatch = '' + substituteInPlace bin/kwinwrapper.in \ + --replace @KDE_INSTALL_FULL_LIBEXECDIR@ "${plasma-workspace}/libexec" + + substituteInPlace bin/plasma-mobile.desktop.cmake \ + --replace @CMAKE_INSTALL_FULL_LIBEXECDIR@ "${plasma-workspace}/libexec" + ''; + + # Ensures dependencies like libqofono (at the very least) are present for the shell. + preFixup = '' + wrapQtApp "$out/bin/kwinwrapper" + ''; + + passthru.providedSessions = [ "plasma-mobile" ]; +} diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 7e89081aef3c7..754ff3027c329 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -1214,6 +1214,7 @@ mapAliases ({ qqc2-breeze-style sddm-kcm systemsettings xdg-desktop-portal-kde + plasma-phone-components ; inherit (plasma5Packages.thirdParty) plasma-applet-caffeine-plus From 6a9d3034896182a2c03c42b530fd7cbe97ce3661 Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Tue, 9 Mar 2021 17:24:34 -0500 Subject: [PATCH 03/12] plasma-nano: Init at 5.23.3 --- pkgs/desktops/plasma-5/default.nix | 1 + pkgs/desktops/plasma-5/plasma-nano/default.nix | 13 +++++++++++++ pkgs/top-level/aliases.nix | 1 + 3 files changed, 15 insertions(+) create mode 100644 pkgs/desktops/plasma-5/plasma-nano/default.nix diff --git a/pkgs/desktops/plasma-5/default.nix b/pkgs/desktops/plasma-5/default.nix index 7bcd4ca0d2544..dd3634ac7cd3e 100644 --- a/pkgs/desktops/plasma-5/default.nix +++ b/pkgs/desktops/plasma-5/default.nix @@ -138,6 +138,7 @@ let plasma-desktop = callPackage ./plasma-desktop {}; plasma-disks = callPackage ./plasma-disks.nix {}; plasma-integration = callPackage ./plasma-integration {}; + plasma-nano = callPackage ./plasma-nano {}; plasma-nm = callPackage ./plasma-nm {}; plasma-pa = callPackage ./plasma-pa.nix { inherit gconf; }; plasma-sdk = callPackage ./plasma-sdk.nix {}; diff --git a/pkgs/desktops/plasma-5/plasma-nano/default.nix b/pkgs/desktops/plasma-5/plasma-nano/default.nix new file mode 100644 index 0000000000000..0960eec33f2d8 --- /dev/null +++ b/pkgs/desktops/plasma-5/plasma-nano/default.nix @@ -0,0 +1,13 @@ +{ + mkDerivation, + extra-cmake-modules, + plasma-framework +}: + +mkDerivation { + name = "plasma-nano"; + nativeBuildInputs = [ extra-cmake-modules ]; + buildInputs = [ + plasma-framework + ]; +} diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 754ff3027c329..6cdee2c1cf2ca 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -1215,6 +1215,7 @@ mapAliases ({ sddm-kcm systemsettings xdg-desktop-portal-kde plasma-phone-components + plasma-nano ; inherit (plasma5Packages.thirdParty) plasma-applet-caffeine-plus From 11f6a19dcf31177778a36eb52fb5bc95ecba3874 Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Sat, 3 Apr 2021 16:32:10 -0400 Subject: [PATCH 04/12] maliit-framework: init at 2.0.0 --- .../misc/maliit-framework/default.nix | 68 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 70 insertions(+) create mode 100644 pkgs/applications/misc/maliit-framework/default.nix diff --git a/pkgs/applications/misc/maliit-framework/default.nix b/pkgs/applications/misc/maliit-framework/default.nix new file mode 100644 index 0000000000000..6a6e66f293bda --- /dev/null +++ b/pkgs/applications/misc/maliit-framework/default.nix @@ -0,0 +1,68 @@ +{ mkDerivation +, lib +, fetchFromGitHub + +, at-spi2-atk +, at-spi2-core +, libepoxy +, gtk3 +, libdatrie +, libselinux +, libsepol +, libthai +, pcre +, util-linux +, wayland +, xorg + +, cmake +, doxygen +, pkg-config +, wayland-protocols +}: + +mkDerivation rec { + pname = "maliit-framework"; + version = "2.0.0"; + + src = fetchFromGitHub { + owner = "maliit"; + repo = "framework"; + rev = version; + sha256 = "138jyvw130kmrldksbk4l38gvvahh3x51zi4vyplad0z5nxmbazb"; + }; + + buildInputs = [ + at-spi2-atk + at-spi2-core + libepoxy + gtk3 + libdatrie + libselinux + libsepol + libthai + pcre + util-linux + wayland + xorg.libXdmcp + xorg.libXtst + ]; + + nativeBuildInputs = [ + cmake + doxygen + pkg-config + wayland-protocols + ]; + + preConfigure = '' + cmakeFlags+="-DQT5_PLUGINS_INSTALL_DIR=$out/$qtPluginPrefix" + ''; + + meta = with lib; { + description = "Core libraries of Maliit and server"; + homepage = "http://maliit.github.io/"; + license = licenses.lgpl21Plus; + maintainers = with maintainers; [ samueldr ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 031e293860f27..35b9b3c01e9a4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3286,6 +3286,8 @@ with pkgs; maigret = callPackage ../tools/security/maigret { }; + maliit-framework = libsForQt5.callPackage ../applications/misc/maliit-framework { }; + mapcidr = callPackage ../tools/misc/mapcidr { }; mapproxy = callPackage ../applications/misc/mapproxy { }; From b9a461490a3ed00b2c9c5692a1cceb9aa69f07a4 Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Sat, 3 Apr 2021 18:43:06 -0400 Subject: [PATCH 05/12] maliit-keyboard: Init at 2.0.0 --- .../misc/maliit-keyboard/default.nix | 82 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 84 insertions(+) create mode 100644 pkgs/applications/misc/maliit-keyboard/default.nix diff --git a/pkgs/applications/misc/maliit-keyboard/default.nix b/pkgs/applications/misc/maliit-keyboard/default.nix new file mode 100644 index 0000000000000..fcbd6cbff19bd --- /dev/null +++ b/pkgs/applications/misc/maliit-keyboard/default.nix @@ -0,0 +1,82 @@ +{ mkDerivation +, lib +, fetchFromGitHub +, fetchpatch + +, anthy +, hunspell +, libchewing +, libpinyin +, maliit-framework +, pcre +, presage +, qtfeedback +, qtmultimedia +, qtquickcontrols2 +, qtgraphicaleffects + +, cmake +, pkg-config +, wrapGAppsHook +}: + +mkDerivation rec { + pname = "maliit-keyboard"; + version = "2.0.0"; + + src = fetchFromGitHub { + owner = "maliit"; + repo = "keyboard"; + rev = version; + sha256 = "10dh0abxq90024dqq3fs8mjxww3igb4l09d19i2fq9f3flvh11hc"; + }; + + patches = [ + (fetchpatch { + # https://github.com/maliit/keyboard/pull/34 + url = "https://github.com/maliit/keyboard/commit/9848a73b737ad46b5790ebf713a559d340c91b82.patch"; + sha256 = "0qrsga0npahjrgbl6mycvl6d6vjm0d17i5jadcn7y6khbhq2y6rg"; + }) + ]; + + postPatch = '' + substituteInPlace data/schemas/org.maliit.keyboard.maliit.gschema.xml \ + --replace /usr/share "$out/share" + ''; + + buildInputs = [ + anthy + hunspell + libchewing + libpinyin + maliit-framework + pcre + presage + qtfeedback + qtmultimedia + qtquickcontrols2 + qtgraphicaleffects + ]; + + cmakeFlags = [ + "-DCMAKE_INSTALL_PREFIX=${placeholder "out"}" + "-DCMAKE_INSTALL_LIBDIR=lib" + ]; + + nativeBuildInputs = [ + cmake + pkg-config + wrapGAppsHook + ]; + + postInstall = '' + glib-compile-schemas "$out"/share/glib-2.0/schemas + ''; + + meta = with lib; { + description = "Virtual keyboard"; + homepage = "http://maliit.github.io/"; + license = with licenses; [ lgpl3Only bsd3 cc-by-30 ]; + maintainers = with maintainers; [ samueldr ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 35b9b3c01e9a4..242faae41b44f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3288,6 +3288,8 @@ with pkgs; maliit-framework = libsForQt5.callPackage ../applications/misc/maliit-framework { }; + maliit-keyboard = libsForQt5.callPackage ../applications/misc/maliit-keyboard { }; + mapcidr = callPackage ../tools/misc/mapcidr { }; mapproxy = callPackage ../applications/misc/mapproxy { }; From fde4f481d992cd1b064844b70905814880aa6627 Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Wed, 14 Jul 2021 18:16:42 -0400 Subject: [PATCH 06/12] nixos/plasma5: Make kwinrc/kdeglobals internally configurable This is used with the Plasma Mobile configuration to configure the system as upstream recommends. --- .../services/x11/desktop-managers/plasma5.nix | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/nixos/modules/services/x11/desktop-managers/plasma5.nix b/nixos/modules/services/x11/desktop-managers/plasma5.nix index 8a1793484e23e..9191a54e2b1b5 100644 --- a/nixos/modules/services/x11/desktop-managers/plasma5.nix +++ b/nixos/modules/services/x11/desktop-managers/plasma5.nix @@ -4,6 +4,28 @@ let xcfg = config.services.xserver; cfg = xcfg.desktopManager.plasma5; + # Use only for **internal** options. + # This is not exactly user-friendly. + kdeConfigurationType = with types; + let + valueTypes = (oneOf [ + bool + float + int + str + ]) // { + description = "KDE Configuration value"; + emptyValue.value = ""; + }; + set = (nullOr (lazyAttrsOf valueTypes)) // { + description = "KDE Configuration set"; + emptyValue.value = {}; + }; + in (lazyAttrsOf set) // { + description = "KDE Configuration file"; + emptyValue.value = {}; + }; + libsForQt5 = pkgs.plasma5Packages; inherit (libsForQt5) kdeGear kdeFrameworks plasma5; inherit (pkgs) writeText; @@ -169,6 +191,20 @@ in type = types.bool; default = false; }; + + # Internally allows configuring kdeglobals globally + kdeglobals = mkOption { + internal = true; + default = {}; + type = kdeConfigurationType; + }; + + # Internally allows configuring kwin globally + kwinrc = mkOption { + internal = true; + default = {}; + type = kdeConfigurationType; + }; }; imports = [ @@ -418,6 +454,11 @@ in services.xserver.displayManager.setupCommands = startplasma; nixpkgs.config.firefox.enablePlasmaBrowserIntegration = true; + + environment.etc = { + "xdg/kwinrc".text = lib.generators.toINI {} cfg.kwinrc; + "xdg/kdeglobals".text = lib.generators.toINI {} cfg.kdeglobals; + }; }) ]; } From da6a39436b20d9aecbb32b863ac8a97a2e8f4941 Mon Sep 17 00:00:00 2001 From: Tyler Slabinski Date: Tue, 26 Mar 2019 12:49:26 -0400 Subject: [PATCH 07/12] nixos/plasma5: Add mobile.enable option for plasma --- .../modules/services/x11/desktop-managers/plasma5.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/nixos/modules/services/x11/desktop-managers/plasma5.nix b/nixos/modules/services/x11/desktop-managers/plasma5.nix index 9191a54e2b1b5..97dac3d325052 100644 --- a/nixos/modules/services/x11/desktop-managers/plasma5.nix +++ b/nixos/modules/services/x11/desktop-managers/plasma5.nix @@ -205,6 +205,14 @@ in default = {}; type = kdeConfigurationType; }; + + mobile.enable = mkOption { + type = types.bool; + default = false; + description = '' + Enable support for running the Plasma Mobile shell. + ''; + }; }; imports = [ @@ -365,6 +373,9 @@ in ++ lib.optional (cfg.phononBackend == "gstreamer") libsForQt5.phonon-backend-gstreamer ++ lib.optional (cfg.phononBackend == "vlc") libsForQt5.phonon-backend-vlc + # Plasma mobile + ++ lib.optional cfg.mobile.enable plasma-phone-components + # Optional hardware support features ++ lib.optionals config.hardware.bluetooth.enable [ bluedevil bluez-qt pkgs.openobex pkgs.obexftp ] ++ lib.optional config.networking.networkmanager.enable plasma-nm From b41923c1ca353d750cc2cf7bcec9c0c3ca4e3b2f Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Wed, 10 Mar 2021 15:26:11 -0500 Subject: [PATCH 08/12] nixos/plasma5: configuration for plasma mobile --- .../services/x11/desktop-managers/plasma5.nix | 58 ++++++++++++++++++- 1 file changed, 55 insertions(+), 3 deletions(-) diff --git a/nixos/modules/services/x11/desktop-managers/plasma5.nix b/nixos/modules/services/x11/desktop-managers/plasma5.nix index 97dac3d325052..e47129898eb7a 100644 --- a/nixos/modules/services/x11/desktop-managers/plasma5.nix +++ b/nixos/modules/services/x11/desktop-managers/plasma5.nix @@ -373,9 +373,6 @@ in ++ lib.optional (cfg.phononBackend == "gstreamer") libsForQt5.phonon-backend-gstreamer ++ lib.optional (cfg.phononBackend == "vlc") libsForQt5.phonon-backend-vlc - # Plasma mobile - ++ lib.optional cfg.mobile.enable plasma-phone-components - # Optional hardware support features ++ lib.optionals config.hardware.bluetooth.enable [ bluedevil bluez-qt pkgs.openobex pkgs.obexftp ] ++ lib.optional config.networking.networkmanager.enable plasma-nm @@ -471,5 +468,60 @@ in "xdg/kdeglobals".text = lib.generators.toINI {} cfg.kdeglobals; }; }) + (mkIf cfg.mobile.enable { + assertions = [ + { + # The user interface breaks without NetworkManager + assertion = config.networking.networkmanager.enable; + message = "Plasma Mobile requires NetworkManager."; + } + { + # The user interface breaks without bluetooth + assertion = config.hardware.bluetooth.enable; + message = "Plasma Mobile requires Bluetooth."; + } + { + # The user interface breaks without pulse + assertion = config.hardware.pulseaudio.enable; + message = "Plasma Mobile requires pulseaudio."; + } + ]; + + environment.systemPackages = + with libsForQt5; + with plasma5; with kdeApplications; with kdeFrameworks; + [ + plasma-phone-components + plasma-nano + ]; + + # The following services are needed or the UI is broken. + hardware.bluetooth.enable = true; + hardware.pulseaudio.enable = true; + networking.networkmanager.enable = true; + + # Recommendations can be found here: + # - https://invent.kde.org/plasma-mobile/plasma-phone-settings/-/tree/master/etc/xdg + # This configuration is the minimum required for Plasma Mobile to *work*. + services.xserver.desktopManager.plasma5 = { + kdeglobals = { + KDE = { + # This forces a numeric PIN for the lockscreen, which is the + # recommendation from upstream. + LookAndFeelPackage = lib.mkDefault "org.kde.plasma.phone"; + }; + }; + kwinrc = { + Windows = { + # Forces windows to be maximized + Placement = lib.mkDefault "Maximizing"; + }; + "org.kde.kdecoration2" = { + # No decorations (title bar) + NoPlugin = lib.mkDefault "true"; + }; + }; + }; + }) ]; } From 13a03fb289a5a83a0d042de51fefe27ee35a9ac1 Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Wed, 14 Jul 2021 15:52:06 -0400 Subject: [PATCH 09/12] nixos/plasma5: Add maliit-keyboard to plasma mobile session --- nixos/modules/services/x11/desktop-managers/plasma5.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nixos/modules/services/x11/desktop-managers/plasma5.nix b/nixos/modules/services/x11/desktop-managers/plasma5.nix index e47129898eb7a..37471bb23b67e 100644 --- a/nixos/modules/services/x11/desktop-managers/plasma5.nix +++ b/nixos/modules/services/x11/desktop-managers/plasma5.nix @@ -493,6 +493,8 @@ in [ plasma-phone-components plasma-nano + pkgs.maliit-framework + pkgs.maliit-keyboard ]; # The following services are needed or the UI is broken. From 7df34e11456ac3c86495e15975a3b37f7d1d2430 Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Tue, 16 Mar 2021 15:25:41 -0400 Subject: [PATCH 10/12] nixos/plasma5: configuration for plasma mobile --- .../services/x11/desktop-managers/plasma5.nix | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/nixos/modules/services/x11/desktop-managers/plasma5.nix b/nixos/modules/services/x11/desktop-managers/plasma5.nix index 37471bb23b67e..dc1e4acea39f3 100644 --- a/nixos/modules/services/x11/desktop-managers/plasma5.nix +++ b/nixos/modules/services/x11/desktop-managers/plasma5.nix @@ -213,6 +213,15 @@ in Enable support for running the Plasma Mobile shell. ''; }; + + mobile.installRecommendedSoftware = mkOption { + type = types.bool; + default = true; + description = '' + Installs software recommended for use with Plasma Mobile, but which + is not strictly required for Plasma Mobile to run. + ''; + }; }; imports = [ @@ -491,11 +500,17 @@ in with libsForQt5; with plasma5; with kdeApplications; with kdeFrameworks; [ + # Basic packages without which Plasma Mobile fails to work properly. plasma-phone-components plasma-nano pkgs.maliit-framework pkgs.maliit-keyboard - ]; + ] + ++ lib.optionals (cfg.mobile.installRecommendedSoftware) [ + # Additional software made for Plasma Mobile. + pkgs.angelfish + ] + ; # The following services are needed or the UI is broken. hardware.bluetooth.enable = true; @@ -524,6 +539,8 @@ in }; }; }; + + services.xserver.displayManager.sessionPackages = [ pkgs.libsForQt5.plasma5.plasma-phone-components ]; }) ]; } From 7f4324c64eb03efb338c731613dd00325e56e173 Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Wed, 24 Mar 2021 16:37:21 -0400 Subject: [PATCH 11/12] nixos/plasma5: Add suggested plasma mobile apps --- .../services/x11/desktop-managers/plasma5.nix | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/nixos/modules/services/x11/desktop-managers/plasma5.nix b/nixos/modules/services/x11/desktop-managers/plasma5.nix index dc1e4acea39f3..31ee63d952265 100644 --- a/nixos/modules/services/x11/desktop-managers/plasma5.nix +++ b/nixos/modules/services/x11/desktop-managers/plasma5.nix @@ -506,10 +506,25 @@ in pkgs.maliit-framework pkgs.maliit-keyboard ] - ++ lib.optionals (cfg.mobile.installRecommendedSoftware) [ + ++ lib.optionals (cfg.mobile.installRecommendedSoftware) (with libsForQt5.plasmaMobileGear;[ # Additional software made for Plasma Mobile. - pkgs.angelfish - ] + alligator + angelfish + audiotube + calindori + kalk + kasts + kclock + keysmith + koko + krecorder + ktrip + kweather + plasma-dialer + plasma-phonebook + plasma-settings + spacebar + ]) ; # The following services are needed or the UI is broken. From 2f12f30f005155e1076034abaeed2d1a3d6fea7d Mon Sep 17 00:00:00 2001 From: Samuel Dionne-Riel Date: Mon, 1 Nov 2021 21:11:50 -0400 Subject: [PATCH 12/12] nixos/plasma5: Split common Plasma config for Mobile from Desktop --- .../services/x11/desktop-managers/plasma5.nix | 107 ++++++++++-------- 1 file changed, 62 insertions(+), 45 deletions(-) diff --git a/nixos/modules/services/x11/desktop-managers/plasma5.nix b/nixos/modules/services/x11/desktop-managers/plasma5.nix index 31ee63d952265..9bacdaa9be984 100644 --- a/nixos/modules/services/x11/desktop-managers/plasma5.nix +++ b/nixos/modules/services/x11/desktop-managers/plasma5.nix @@ -230,22 +230,8 @@ in ]; config = mkMerge [ - (mkIf cfg.enable { - - # Seed our configuration into nixos-generate-config - system.nixos-generate-config.desktopConfiguration = [ - '' - # Enable the Plasma 5 Desktop Environment. - services.xserver.displayManager.sddm.enable = true; - services.xserver.desktopManager.plasma5.enable = true; - '' - ]; - - services.xserver.displayManager.sessionPackages = [ pkgs.libsForQt5.plasma5.plasma-workspace ]; - # Default to be `plasma` (X11) instead of `plasmawayland`, since plasma wayland currently has - # many tiny bugs. - # See: https://github.com/NixOS/nixpkgs/issues/143272 - services.xserver.displayManager.defaultSession = mkDefault "plasma"; + # Common Plasma dependencies + (mkIf (cfg.enable || cfg.mobile.enable) { security.wrappers = { kcheckpass = { @@ -331,37 +317,24 @@ in kdeplasma-addons kgamma5 khotkeys - kinfocenter - kmenuedit kscreen kscreenlocker - ksystemstats kwayland kwin kwrited libkscreen libksysguard milou - plasma-systemmonitor plasma-browser-integration plasma-integration polkit-kde-agent - spectacle - systemsettings plasma-desktop plasma-workspace plasma-workspace-wallpapers - dolphin - dolphin-plugins - ffmpegthumbs - kdegraphics-thumbnailers - khelpcenter - kio-extras konsole oxygen - print-manager breeze-icons pkgs.hicolor-icon-theme @@ -372,10 +345,6 @@ in qtvirtualkeyboard pkgs.xdg-user-dirs # Update user dirs as described in https://freedesktop.org/wiki/Software/xdg-user-dirs/ - - elisa - gwenview - okular ] # Phonon audio backend @@ -449,18 +418,6 @@ in serviceConfig.Type = "oneshot"; script = activationScript; }; - - plasma-run-with-systemd = { - description = "Run KDE Plasma via systemd"; - wantedBy = [ "basic.target" ]; - serviceConfig.Type = "oneshot"; - script = '' - ${set_XDG_CONFIG_HOME} - - ${kdeFrameworks.kconfig}/bin/kwriteconfig5 \ - --file startkderc --group General --key systemdBoot ${lib.boolToString cfg.runUsingSystemd} - ''; - }; }; xdg.portal.enable = true; @@ -477,6 +434,66 @@ in "xdg/kdeglobals".text = lib.generators.toINI {} cfg.kdeglobals; }; }) + + # Plasma Desktop + (mkIf cfg.enable { + + # Seed our configuration into nixos-generate-config + system.nixos-generate-config.desktopConfiguration = [ + '' + # Enable the Plasma 5 Desktop Environment. + services.xserver.displayManager.sddm.enable = true; + services.xserver.desktopManager.plasma5.enable = true; + '' + ]; + + services.xserver.displayManager.sessionPackages = [ pkgs.libsForQt5.plasma5.plasma-workspace ]; + # Default to be `plasma` (X11) instead of `plasmawayland`, since plasma wayland currently has + # many tiny bugs. + # See: https://github.com/NixOS/nixpkgs/issues/143272 + services.xserver.displayManager.defaultSession = mkDefault "plasma"; + + environment.systemPackages = + with libsForQt5; + with plasma5; with kdeGear; with kdeFrameworks; + [ + ksystemstats + kinfocenter + kmenuedit + plasma-systemmonitor + spectacle + systemsettings + + dolphin + dolphin-plugins + ffmpegthumbs + kdegraphics-thumbnailers + khelpcenter + kio-extras + print-manager + + elisa + gwenview + okular + ] + ; + + systemd.user.services = { + plasma-run-with-systemd = { + description = "Run KDE Plasma via systemd"; + wantedBy = [ "basic.target" ]; + serviceConfig.Type = "oneshot"; + script = '' + ${set_XDG_CONFIG_HOME} + + ${kdeFrameworks.kconfig}/bin/kwriteconfig5 \ + --file startkderc --group General --key systemdBoot ${lib.boolToString cfg.runUsingSystemd} + ''; + }; + }; + }) + + # Plasma Mobile (mkIf cfg.mobile.enable { assertions = [ {