Commit 3208b3b 1 parent 7a0c544 commit 3208b3b Copy full SHA for 3208b3b
File tree 3 files changed +52
-0
lines changed
3 files changed +52
-0
lines changed Original file line number Diff line number Diff line change
1
+ {
2
+ config ,
3
+ lib ,
4
+ pkgs ,
5
+ ...
6
+ } : let
7
+ inherit ( lib . modules ) mkIf ;
8
+ inherit ( lib . options ) mkOption mkEnableOption mkPackageOption ;
9
+ inherit ( lib . generators ) toKeyValue ;
10
+ inherit ( lib . rum . types ) tofiSettingsType ;
11
+
12
+ cfg = config . rum . programs . tofi ;
13
+ in {
14
+ options . rum . programs . tofi = {
15
+ enable = mkEnableOption "tofi" ;
16
+
17
+ package = mkPackageOption pkgs "tofi" { } ;
18
+
19
+ settings = mkOption {
20
+ type = tofiSettingsType ;
21
+ default = { } ;
22
+ example = {
23
+ text-color = "#FFFFFF" ;
24
+ num-results = 0 ;
25
+ horizontal = false ;
26
+ } ;
27
+ description = ''
28
+ The configuration converted into "key = value" and written to
29
+ `${ config . directory } /.config/tofi/config`.
30
+ Please reference tofi(5) (manpage) at https://github.com/philj56/tofi/blob/master/doc/tofi.5.md,
31
+ or see an example at https://github.com/philj56/tofi/blob/master/doc/config.
32
+ '' ;
33
+ } ;
34
+ } ;
35
+
36
+ config = mkIf cfg . enable {
37
+ packages = [ cfg . package ] ;
38
+ files . ".config/tofi/config" . text = mkIf ( cfg . settings != { } ) ( toKeyValue cfg . settings ) ;
39
+ } ;
40
+ }
Original file line number Diff line number Diff line change 1
1
{ lib } : {
2
2
gtkType = import ./gtkType.nix { inherit lib ; } ;
3
+ tofiSettingsType = import ./tofiSettingsType.nix { inherit lib ; } ;
3
4
}
Original file line number Diff line number Diff line change
1
+ { lib } : let
2
+ inherit ( lib . types ) attrsOf oneOf str path bool int float ;
3
+ in (
4
+ attrsOf ( oneOf [
5
+ str
6
+ path
7
+ bool
8
+ int
9
+ float
10
+ ] )
11
+ )
You can’t perform that action at this time.
0 commit comments