@@ -7,6 +7,23 @@ inputs: {
7
7
inherit ( pkgs . stdenv . hostPlatform ) system ;
8
8
selflib = import ./lib.nix lib ;
9
9
cfg = config . programs . hyprland ;
10
+
11
+ hyprlangType = with lib . types ; let
12
+ valueType =
13
+ nullOr ( oneOf [
14
+ bool
15
+ int
16
+ float
17
+ str
18
+ path
19
+ ( attrsOf valueType )
20
+ ( listOf valueType )
21
+ ] )
22
+ // {
23
+ description = "Hyprlang configuration value" ;
24
+ } ;
25
+ in
26
+ valueType ;
10
27
in {
11
28
options = {
12
29
programs . hyprland = {
20
37
} ;
21
38
22
39
settings = lib . mkOption {
23
- type = with lib . types ; let
24
- valueType =
25
- nullOr ( oneOf [
26
- bool
27
- int
28
- float
29
- str
30
- path
31
- ( attrsOf valueType )
32
- ( listOf valueType )
33
- ] )
34
- // {
35
- description = "Hyprland configuration value" ;
36
- } ;
37
- in
38
- valueType ;
40
+ type = hyprlangType ;
39
41
default = { } ;
40
42
description = ''
41
43
Hyprland configuration written in Nix. Entries with the same key
70
72
'' ;
71
73
} ;
72
74
75
+ defaultSettings = lib . mkOption {
76
+ type = hyprlangType ;
77
+ default =
78
+ {
79
+ permission = [
80
+ "${ cfg . portalPackage } /libexec/.xdg-desktop-portal-hyprland-wrapped, screencopy, allow"
81
+ "${ lib . getExe pkgs . grim } , screencopy, allow"
82
+ ] ;
83
+ }
84
+ // lib . mkIf cfg . withUWSM {
85
+ exec-once = "uwsm finalize" ;
86
+ } ;
87
+ description = ''
88
+ Default settings. Can be disabled by setting this option to `{}`.
89
+ '' ;
90
+ } ;
91
+
73
92
extraConfig = lib . mkOption {
74
93
type = lib . types . lines ;
75
94
default = "" ;
@@ -146,6 +165,12 @@ in {
146
165
bottomCommandsPrefixes = cfg . bottomPrefixes ;
147
166
}
148
167
cfg . settings )
168
+ + lib . optionalString ( cfg . defaultSettings != { } )
169
+ ( selflib . toHyprlang {
170
+ topCommandsPrefixes = cfg . topPrefixes ;
171
+ bottomCommandsPrefixes = cfg . bottomPrefixes ;
172
+ }
173
+ cfg . defaultSettings )
149
174
+ lib . optionalString ( cfg . extraConfig != "" ) cfg . extraConfig ;
150
175
} ;
151
176
} )
0 commit comments