Files
nix-config/modules/nixos/desktop/plasma/default.nix
mjallen18 c5ba5d4164 bluetooth
2026-04-15 11:39:41 -05:00

63 lines
1.6 KiB
Nix
Executable File

{
config,
lib,
pkgs,
namespace,
...
}:
let
inherit (lib.${namespace}) mkBoolOpt mkOpt;
cfg = config.${namespace}.desktop.plasma;
in
{
options.${namespace}.desktop.plasma = {
enable = lib.mkEnableOption "KDE Plasma 6 desktop environment";
wayland.enable = mkBoolOpt true "Use the Wayland session (default) instead of X11";
wallpaper = {
enable = mkBoolOpt false "Enable automatic wallpaper management (Bing/NASA daily download)";
source = mkOpt (lib.types.enum [
"bing"
"nasa"
]) "bing" "Source for the wallpaper (bing or nasa)";
};
};
config = lib.mkIf cfg.enable (
lib.mkMerge [
{
services = {
desktopManager.plasma6.enable = true;
displayManager.sddm = {
enable = true;
wayland.enable = cfg.wayland.enable;
};
# Required for Bluetooth D-Bus policy (allows WirePlumber/PipeWire
# to communicate with bluetoothd on the system bus).
blueman.enable = true;
};
xdg.portal.extraPortals = [ ];
environment.systemPackages = with pkgs; [
kdePackages.kdeplasma-addons
];
}
# Wallpaper management: wire the shared wallpaper module in when requested.
# plasma-apply-wallpaperimage hot-reloads the wallpaper in the running session.
(lib.mkIf cfg.wallpaper.enable {
${namespace}.wallpaper = {
enable = true;
source = cfg.wallpaper.source;
reloadCommand = "${lib.getExe' pkgs.kdePackages.plasma-workspace "plasma-apply-wallpaperimage"} /run/wallpaper.jpg";
};
})
]
);
}