File tree Expand file tree Collapse file tree 2 files changed +26
-7
lines changed
Expand file tree Collapse file tree 2 files changed +26
-7
lines changed Original file line number Diff line number Diff line change 66} : let
77 inherit ( lib . options ) mkEnableOption mkPackageOption mkOption ;
88 inherit ( lib . meta ) getExe ;
9- inherit ( lib . types ) nullOr str ;
9+ inherit ( lib . types ) nullOr str enum ;
1010 inherit ( lib ) mkIf optionals ;
1111
1212 cfg = config . services . tailray ;
2828 default = null ;
2929 example = "https://headplane.example.com/admin/login" ;
3030 } ;
31+
32+ theme = mkOption {
33+ description = "Icon Theme" ;
34+ type = enum [ "light" "dark" ] ;
35+ default = "light" ;
36+ example = "dark" ;
37+ } ;
3138 } ;
3239
3340 config = mkIf cfg . enable {
4754 ExecStart = "${ getExe cfg . package } " ;
4855 Restart = "always" ;
4956 RestartSec = "10" ;
50- Environment = optionals ( cfg . adminUrl != null ) [
51- "TAILRAY_ADMIN_URL=${ cfg . adminUrl } "
52- ] ;
57+ Environment =
58+ lib . optional ( cfg . adminUrl != null )
59+ [ "TAILRAY_ADMIN_URL=${ cfg . adminUrl } " ]
60+ ++ [
61+ "TAILRAY_THEME=${ cfg . theme } "
62+ ] ;
5363 } ;
5464 } ;
5565 } ;
Original file line number Diff line number Diff line change 66} : let
77 inherit ( lib . options ) mkEnableOption mkPackageOption mkOption ;
88 inherit ( lib . meta ) getExe ;
9- inherit ( lib . types ) nullOr str ;
9+ inherit ( lib . types ) nullOr str enum ;
1010 inherit ( lib ) mkIf ;
1111
1212 cfg = config . services . tailray ;
2828 default = null ;
2929 example = "https://headplane.example.com/admin/login" ;
3030 } ;
31+
32+ theme = mkOption {
33+ description = "Icon Theme" ;
34+ type = enum [ "light" "dark" ] ;
35+ default = "light" ;
36+ example = "dark" ;
37+ } ;
3138 } ;
3239
3340 config = mkIf cfg . enable {
4047 Restart = "always" ;
4148 RestartSec = "10" ;
4249 } ;
43-
44- environment . TAILRAY_ADMIN_URL = mkIf ( cfg . adminUrl != null ) cfg . adminUrl ;
50+ environment = {
51+ TAILRAY_THEME = cfg . theme ;
52+ TAILRAY_ADMIN_URL = mkIf ( cfg . adminUrl != null ) cfg . adminUrl ;
53+ } ;
4554 } ;
4655 } ;
4756}
You can’t perform that action at this time.
0 commit comments