-
Notifications
You must be signed in to change notification settings - Fork 79
/
Copy pathapp-menu.nix
59 lines (57 loc) · 1.47 KB
/
app-menu.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
{ lib, ... }:
let
inherit (import ./lib.nix { inherit lib; }) configValueType;
inherit (import ./default.nix { inherit lib; }) positionType sizeType;
mkBoolOption =
description:
lib.mkOption {
type = with lib.types; nullOr bool;
default = null;
example = true;
inherit description;
};
in
{
appMenu = {
opts = {
position = lib.mkOption {
type = positionType;
example = {
horizontal = 100;
vertical = 300;
};
description = "The position of the widget. (Only for desktop widget)";
};
size = lib.mkOption {
type = sizeType;
example = {
width = 500;
height = 50;
};
description = "The size of the widget. (Only for desktop widget)";
};
compactView = mkBoolOption "Whether to show the app menu in a compact view";
settings = lib.mkOption {
type = configValueType;
default = null;
example = {
Appearance = {
compactView = true;
};
};
description = ''
Extra configuration for the widget
'';
apply = settings: if settings == null then { } else settings;
};
};
convert =
{ compactView, settings, ... }:
{
name = "org.kde.plasma.appmenu";
config = lib.recursiveUpdate {
General = lib.filterAttrs (_: v: v != null) { inherit compactView; };
} settings;
};
};
}