2021-11-15 22:28:01 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
cfg = config.ptw.programs.plasma;
|
|
|
|
in {
|
|
|
|
options.ptw.programs.plasma = {
|
|
|
|
enable = lib.mkEnableOption "Enable KDE Plasma";
|
2022-03-21 14:24:57 +00:00
|
|
|
mobile = {
|
|
|
|
enable = lib.mkEnableOption "Enable Plasma Mobile";
|
|
|
|
};
|
|
|
|
wayland = {
|
|
|
|
enable = lib.mkOption {
|
|
|
|
default = true;
|
|
|
|
description = "Ignore NixOS 'recommendations' and use the Wayland session by default";
|
|
|
|
};
|
|
|
|
};
|
2022-07-13 18:19:53 +00:00
|
|
|
sddm = {
|
|
|
|
backgroundImage = lib.mkOption {
|
|
|
|
default = "${pkgs.sddm-sugar-dark}/usr/share/sddm/themes/sugar-dark/Background.jpg";
|
|
|
|
description = "The background image to use with sddm-sugar-dark";
|
|
|
|
};
|
|
|
|
screenWidth = lib.mkOption {
|
|
|
|
default = 1920;
|
|
|
|
description = "Width of the screen";
|
|
|
|
};
|
|
|
|
screenHeight = lib.mkOption {
|
|
|
|
default = 1080;
|
|
|
|
description = "Width of the screen";
|
|
|
|
};
|
|
|
|
};
|
2021-11-15 22:28:01 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
config = lib.mkIf cfg.enable {
|
2022-07-13 17:35:32 +00:00
|
|
|
security.pam.services = {
|
|
|
|
login.enableKwallet = true;
|
|
|
|
greetd.enableKwallet = true;
|
|
|
|
};
|
2022-03-21 14:24:57 +00:00
|
|
|
services.xserver = {
|
|
|
|
desktopManager.plasma5 = {
|
|
|
|
enable = true;
|
2022-07-13 17:37:41 +00:00
|
|
|
runUsingSystemd = true;
|
|
|
|
supportDDC = true;
|
2022-03-21 14:24:57 +00:00
|
|
|
mobile.enable = cfg.mobile.enable;
|
2022-06-30 17:59:45 +00:00
|
|
|
|
|
|
|
kdeglobals = lib.mkIf cfg.mobile.enable {
|
|
|
|
KDE = {
|
|
|
|
StartDragDist = "10";
|
|
|
|
LookAndFeelPackage = "org.kde.plasma.phone";
|
|
|
|
};
|
|
|
|
|
|
|
|
Icons = {
|
|
|
|
Theme = "breeze";
|
|
|
|
};
|
|
|
|
|
|
|
|
General = {
|
|
|
|
ColorScheme = "breeze";
|
|
|
|
Name = "breeze";
|
|
|
|
XftHintStyle = "none";
|
|
|
|
XftSubPixel = "none";
|
|
|
|
shadeSortColumn = "true";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2022-07-13 18:19:53 +00:00
|
|
|
kwinrc = lib.mkIf cfg.mobile.enable {
|
2022-06-30 17:59:45 +00:00
|
|
|
Plugins = {
|
|
|
|
"org.kde.phone.multitaskingEnabled" = "false";
|
|
|
|
"kwin4_effect_eyeonscreenEnabled" = "false";
|
|
|
|
"kwin4_effect_windowapertureEnabled" = "false";
|
|
|
|
blurEnabled = "false";
|
|
|
|
contrastEnabled = "false";
|
|
|
|
};
|
|
|
|
|
|
|
|
Windows = {
|
|
|
|
Placement = "Maximizing";
|
|
|
|
};
|
|
|
|
|
|
|
|
TabBox = {
|
|
|
|
TouchBorderActive = "9";
|
|
|
|
TouchBorderAlternativeActive = "9";
|
|
|
|
BorderActivate = "9";
|
|
|
|
};
|
|
|
|
|
|
|
|
"Effect-PresentWindows" = {
|
|
|
|
BorderActivateAll = "9";
|
|
|
|
};
|
|
|
|
|
|
|
|
"org.kde.kdecoration2" = {
|
|
|
|
NoPlugin = "true";
|
|
|
|
};
|
|
|
|
|
|
|
|
TouchEdges = {
|
|
|
|
Left = "None";
|
|
|
|
Right = "None";
|
|
|
|
};
|
|
|
|
|
|
|
|
Wayland = {
|
|
|
|
InputMethod = "${pkgs.maliit-keyboard}/usr/share/applications/com.github.maliit.keyboard.desktop";
|
|
|
|
};
|
|
|
|
};
|
2022-03-21 14:24:57 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# See https://github.com/NixOS/nixpkgs/commit/a506f9c79700255c215dddb53455d5e2bed6c1af
|
2022-06-30 17:59:45 +00:00
|
|
|
displayManager = {
|
|
|
|
defaultSession = lib.mkIf cfg.wayland.enable "plasmawayland";
|
|
|
|
#sessionPackages = lib.mkIf cfg.mobile.enable [ pkgs.libsForQt5.plasma5.plasma-mobile ];
|
|
|
|
};
|
2021-11-15 22:28:01 +00:00
|
|
|
};
|
|
|
|
|
2023-01-19 14:17:15 +00:00
|
|
|
users.users.greeter = {
|
|
|
|
home = "/var/lib/greeter";
|
|
|
|
createHome = true;
|
|
|
|
isSystemUser = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
services.greetd = {
|
|
|
|
enable = true;
|
|
|
|
settings = let
|
|
|
|
swayGreeterConfig = pkgs.writeText "sway-config" ''
|
|
|
|
exec "${pkgs.qtgreet}/bin/qtgreet -d ${config.users.users.greeter.home}/data; ${pkgs.sway}/bin/swaymsg exit"
|
|
|
|
|
|
|
|
bindsym Mod4+shift+e exec ${pkgs.sway}/bin/swaynag \
|
|
|
|
-t warning \
|
|
|
|
-m 'What do you want to do?' \
|
|
|
|
-b 'Poweroff' 'systemctl poweroff' \
|
|
|
|
-b 'Reboot' 'systemctl reboot'
|
|
|
|
|
|
|
|
input * {
|
|
|
|
xkb_layout de
|
|
|
|
}
|
|
|
|
'';
|
|
|
|
in {
|
|
|
|
default_session = {
|
|
|
|
command = "${pkgs.sway}/bin/sway --config ${swayGreeterConfig}";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
2021-11-15 22:28:01 +00:00
|
|
|
xdg.portal = {
|
|
|
|
enable = true;
|
|
|
|
extraPortals = [ pkgs.xdg-desktop-portal-kde ];
|
|
|
|
};
|
|
|
|
|
2022-08-06 12:10:47 +00:00
|
|
|
environment = {
|
|
|
|
systemPackages = let
|
|
|
|
plasmaMobilePackages = with pkgs.libsForQt5; with plasma5; with kdeApplications; with kdeFrameworks; [
|
|
|
|
plasma-mobile
|
|
|
|
plasma-nano
|
|
|
|
pkgs.maliit-framework
|
|
|
|
pkgs.maliit-keyboard
|
|
|
|
];
|
|
|
|
kdePackages = with pkgs.libsForQt5; [
|
|
|
|
okular
|
|
|
|
kdeconnect-kde
|
|
|
|
breeze-gtk
|
2022-10-28 14:44:58 +00:00
|
|
|
#bismuth
|
2022-08-06 12:10:47 +00:00
|
|
|
gwenview
|
2022-10-15 10:06:07 +00:00
|
|
|
yakuake
|
|
|
|
|
|
|
|
kdeplasma-addons
|
|
|
|
plasma-nm
|
2022-08-06 12:10:47 +00:00
|
|
|
] ++ lib.optionals cfg.mobile.enable plasmaMobilePackages;
|
|
|
|
packages = with pkgs; [
|
2022-10-15 10:06:07 +00:00
|
|
|
kde-rounded-corners
|
2022-08-06 12:10:47 +00:00
|
|
|
index-fm
|
|
|
|
rsibreak
|
|
|
|
kalendar
|
|
|
|
kate
|
|
|
|
okular
|
2022-10-21 14:14:45 +00:00
|
|
|
ark
|
|
|
|
kcalc
|
2022-08-06 12:10:47 +00:00
|
|
|
|
|
|
|
# Some Gnome software
|
|
|
|
gnome.totem
|
|
|
|
];
|
|
|
|
in kdePackages ++ packages;
|
|
|
|
sessionVariables = let
|
|
|
|
askPass = "${pkgs.libsForQt5.ksshaskpass}/bin/ksshaskpass";
|
|
|
|
in {
|
|
|
|
SSH_ASKPASS = askPass;
|
|
|
|
SSH_ASKPASS_REQUIRE = "prefer";
|
|
|
|
GIT_ASKPASS = askPass;
|
|
|
|
};
|
|
|
|
};
|
2021-11-15 22:28:01 +00:00
|
|
|
};
|
|
|
|
}
|