mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 14:54:29 +01:00
nixos/plasma5: Make kwinrc/kdeglobals internally configurable
This is used with the Plasma Mobile configuration to configure the system as upstream recommends.
This commit is contained in:
parent
b9a461490a
commit
fde4f481d9
1 changed files with 41 additions and 0 deletions
|
@ -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;
|
||||
};
|
||||
})
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue