plasma wip

This commit is contained in:
RingOfStorms (Joshua Bell) 2025-12-01 09:47:04 -06:00
parent 1dcc9b436d
commit e06f1e887b
6 changed files with 30 additions and 151 deletions

View file

@ -45,12 +45,6 @@ in
description = "Enable Breeze Dark, GTK Breeze-Dark, and dark cursors."; description = "Enable Breeze Dark, GTK Breeze-Dark, and dark cursors.";
}; };
flatpak.enable = mkOption {
type = types.bool;
default = false;
description = "Enable Flatpak.";
};
sddm.autologinUser = mkOption { sddm.autologinUser = mkOption {
type = types.nullOr types.str; type = types.nullOr types.str;
default = null; default = null;
@ -98,96 +92,6 @@ in
}; };
}; };
}; };
# TODO how to use same type as home manager programs.plasma.panels.*
# panels = mkOption {
# type = types.listOf types.;
# default = [ defaultPanel ];
# };
shortcuts = {
terminal = mkOption {
type = types.str;
default = "kitty";
};
launcher = mkOption {
type = types.enum [
"krunner"
"rofi"
];
default = "krunner";
};
useI3Like = mkOption {
type = types.bool;
default = true;
};
closeWindow = mkOption {
type = types.str;
default = "Meta+Q";
};
workspaceKeys = mkOption {
type = types.listOf types.str;
default = [
"Meta+1"
"Meta+2"
"Meta+3"
"Meta+4"
"Meta+5"
"Meta+6"
"Meta+7"
"Meta+8"
"Meta+9"
];
};
moveWindowWorkspaceKeys = mkOption {
type = types.listOf types.str;
default = [
"Meta+Shift+1"
"Meta+Shift+2"
"Meta+Shift+3"
"Meta+Shift+4"
"Meta+Shift+5"
"Meta+Shift+6"
"Meta+Shift+7"
"Meta+Shift+8"
"Meta+Shift+9"
];
};
};
monitors = {
enableOverrides = mkOption {
type = types.bool;
default = false;
};
commands = mkOption {
type = types.listOf types.str;
default = [ ];
};
scriptDelayMs = mkOption {
type = types.int;
default = 500;
};
};
apps.include = mkOption {
type = types.listOf types.package;
default = with pkgs; [
# Core KDE tools
kdePackages.kde-gtk-config
kdePackages.konsole
kdePackages.dolphin
kdePackages.spectacle
kdePackages.plasma-browser-integration
kdePackages.plasma-workspace-wallpapers
# Panel applets required for widgets
kdePackages.plasma-nm # org.kde.plasma.networkmanagement
kdePackages.bluedevil # org.kde.plasma.bluetooth
kdePackages.plasma-pa # org.kde.plasma.volume
kdePackages.kdeplasma-addons # extra widgets
kdePackages.powerdevil # power management services
];
};
}; };
config = mkIf cfg.enable (mkMerge [ config = mkIf cfg.enable (mkMerge [
@ -216,7 +120,6 @@ in
}; };
services.power-profiles-daemon.enable = true; services.power-profiles-daemon.enable = true;
services.flatpak.enable = cfg.flatpak.enable;
# Wayland-friendly Electron/Chromium # Wayland-friendly Electron/Chromium
environment.sessionVariables.NIXOS_OZONE_WL = "1"; environment.sessionVariables.NIXOS_OZONE_WL = "1";
@ -231,7 +134,22 @@ in
programs.kdeconnect.enable = true; programs.kdeconnect.enable = true;
# Useful KDE packages # Useful KDE packages
environment.systemPackages = cfg.apps.include; environment.systemPackages = with pkgs; [
# Core KDE tools
kdePackages.kde-gtk-config
kdePackages.konsole
kdePackages.dolphin
kdePackages.spectacle
kdePackages.plasma-browser-integration
# kdePackages.plasma-workspace-wallpapers
# Panel applets required for widgets
kdePackages.plasma-nm # org.kde.plasma.networkmanagement
kdePackages.bluedevil # org.kde.plasma.bluetooth
kdePackages.plasma-pa # org.kde.plasma.volume
kdePackages.kdeplasma-addons # extra widgets
kdePackages.powerdevil # power management services;
];
# Keyboard like sway/i3 # Keyboard like sway/i3
console.useXkbConfig = true; console.useXkbConfig = true;

View file

@ -5,7 +5,7 @@
}: }:
let let
cfg = osConfig.ringofstorms.dePlasma; cfg = osConfig.ringofstorms.dePlasma;
inherit (lib) mkIf; inherit (lib) mkIf mkDefault;
defaultPanel = { defaultPanel = {
location = "top"; location = "top";
@ -36,6 +36,6 @@ in
{ {
options = { }; options = { };
config = mkIf cfg.enable { config = mkIf cfg.enable {
programs.plasma.panels = [ defaultPanel ]; programs.plasma.panels = mkDefault [ defaultPanel ];
}; };
} }

View file

@ -1,4 +1,4 @@
{ osConfig, lib, pkgs, ... }: { osConfig, lib, ... }:
let let
cfg = osConfig.ringofstorms.dePlasma; cfg = osConfig.ringofstorms.dePlasma;
inherit (lib) mkIf; inherit (lib) mkIf;
@ -6,10 +6,8 @@ in
{ {
options = {}; options = {};
config = mkIf cfg.enable { config = mkIf cfg.enable {
# plasma-manager base enable
programs.plasma = { programs.plasma = {
enable = true; enable = true;
# Tweak some global Plasma config if desired later
}; };
}; };
} }

View file

@ -1,7 +1,5 @@
{ osConfig, lib, ... }: { ... }:
let let
cfg = osConfig.ringofstorms.dePlasma;
inherit (lib) mkIf;
workspaces = builtins.genList (i: i + 1) 9; workspaces = builtins.genList (i: i + 1) 9;
kwinWorkspace = builtins.listToAttrs ( kwinWorkspace = builtins.listToAttrs (
map (i: { map (i: {
@ -15,42 +13,22 @@ let
value = "Meta+Shift+${toString i}"; value = "Meta+Shift+${toString i}";
}) workspaces }) workspaces
); );
krunnerShortcut =
if cfg.shortcuts.launcher == "krunner" then
{
krunner = {
"Run Command" = "Meta+Space";
};
}
else
{ };
in in
{ {
options = { }; options = { };
config = mkIf (cfg.enable && cfg.shortcuts.useI3Like) { config = {
programs.plasma.shortcuts = ( programs.plasma.shortcuts = ({
{ kwin = ({ "Close Window" = "Meta+Q"; } // kwinWorkspace // kwinMoveWorkspace);
kwin = ({ "Close Window" = cfg.shortcuts.closeWindow; } // kwinWorkspace // kwinMoveWorkspace); krunner = {
} "Run Command" = "Meta+Space";
// krunnerShortcut };
); });
programs.plasma.hotkeys.commands = { programs.plasma.hotkeys.commands = {
ringofstorms-terminal = { ringofstorms-terminal = {
key = "Meta+Return"; key = "Meta+Return";
command = cfg.shortcuts.terminal; command = "foot"; # TODO configurable?
}; };
}
// (
if cfg.shortcuts.launcher == "rofi" then
{
ringofstorms-launcher = {
key = "Meta+Space";
command = "rofi -show drun";
}; };
}
else
{ }
);
}; };
} }

View file

@ -16,8 +16,6 @@ in
lookAndFeel = "org.kde.breezedark.desktop"; lookAndFeel = "org.kde.breezedark.desktop";
cursor.theme = "breeze_cursors"; cursor.theme = "breeze_cursors";
}; };
fonts = { }; # keep defaults
kscreenlocker = { }; # swaylock analog not applicable; left default
}; };
}; };
} }

View file

@ -17,21 +17,8 @@ in
]; ];
scriptDelayMs = 500; scriptDelayMs = 500;
}; };
shortcuts = {
terminal = "kitty";
launcher = "krunner";
useI3Like = true;
closeWindow = "Meta+Q";
};
panel = {
enabled = true;
location = "top";
height = 28;
opacity = "translucent";
};
sddm.autologinUser = null; sddm.autologinUser = null;
flatpak.enable = false; # GPU vendor left unset; set per machine if needed TODO
# GPU vendor left unset; set per machine if needed
}; };
}; };
} }