mbp
This commit is contained in:
@@ -1,30 +1,55 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
namespace,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (lib.${namespace}) mkBoolOpt;
|
||||
inherit (lib.${namespace}) mkBoolOpt mkOpt;
|
||||
cfg = config.${namespace}.desktop.plasma;
|
||||
wallpaperCfg = config.${namespace}.wallpaper;
|
||||
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";
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
services = {
|
||||
desktopManager.plasma6.enable = true;
|
||||
wallpaper = {
|
||||
enable = mkBoolOpt false "Enable automatic wallpaper management (Bing/NASA daily download)";
|
||||
|
||||
displayManager.sddm = {
|
||||
enable = true;
|
||||
wayland.enable = cfg.wayland.enable;
|
||||
};
|
||||
source = mkOpt (lib.types.enum [
|
||||
"bing"
|
||||
"nasa"
|
||||
]) "bing" "Source for the wallpaper (bing or nasa)";
|
||||
};
|
||||
|
||||
xdg.portal.extraPortals = [ ];
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable (
|
||||
lib.mkMerge [
|
||||
{
|
||||
services = {
|
||||
desktopManager.plasma6.enable = true;
|
||||
|
||||
displayManager.sddm = {
|
||||
enable = true;
|
||||
wayland.enable = cfg.wayland.enable;
|
||||
};
|
||||
};
|
||||
|
||||
xdg.portal.extraPortals = [ ];
|
||||
}
|
||||
|
||||
# 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";
|
||||
};
|
||||
})
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user