File tree Expand file tree Collapse file tree 1 file changed +23
-10
lines changed
Expand file tree Collapse file tree 1 file changed +23
-10
lines changed Original file line number Diff line number Diff line change 11{
2+ options ,
23 config ,
34 lib ,
45 pkgs ,
2122 yaml = pkgs . formats . yaml { } ;
2223in
2324{
24- meta . maintainers = [ maintainers . jolars ] ;
25+ meta . maintainers = [
26+ maintainers . jolars
27+ maintainers . mightyiam
28+ ] ;
2529
2630 options . services . way-displays = {
2731 enable = mkEnableOption "way-displays" ;
2832
2933 package = lib . mkPackageOption pkgs "way-displays" { } ;
3034
3135 settings = mkOption {
32- type = yaml . type ;
36+ type = types . nullOr yaml . type ;
3337 default = { } ;
3438 example = literalExpression ''
3539 {
6165 {file}`$XDG_CONFIG_HOME/way-displays/cfg.yml`. See
6266 <https://github.com/alex-courtis/way-displays/wiki/Configuration> for a
6367 description of available options.
68+
69+ When `null` a configuration file is not generated,
70+ which allows way-displays to write its own configuration.
6471 '' ;
6572 } ;
6673
7986 ( lib . hm . assertions . assertPlatform "services.way-displays" pkgs lib . platforms . linux )
8087 ] ;
8188
82- xdg . configFile . "way-displays/cfg.yaml" . source =
83- yaml . generate "way-displays-config.yaml"
84- ( mergeSets [
85- {
86- CALLBACK_CMD = "${ pkgs . libnotify } /bin/notify-send \" way-displays \ ${CALLBACK_LEVEL}\" \" \ ${CALLBACK_MSG}\" " ;
87- }
88- cfg . settings
89- ] ) ;
89+ home . packages = [ cfg . package ] ;
90+
91+ wayland . windowManager = lib . mapAttrs ( name : _ : {
92+ systemd . variables = [ "XDG_VTNR" ] ;
93+ } ) options . wayland . windowManager ;
94+
95+ xdg . configFile . "way-displays/cfg.yaml" = mkIf ( cfg . settings != null ) {
96+ source = yaml . generate "way-displays-config.yaml" ( mergeSets [
97+ {
98+ CALLBACK_CMD = "${ pkgs . libnotify } /bin/notify-send \" way-displays \ ${CALLBACK_LEVEL}\" \" \ ${CALLBACK_MSG}\" " ;
99+ }
100+ cfg . settings
101+ ] ) ;
102+ } ;
90103
91104 systemd . user . services . way-displays = {
92105 Unit = {
You can’t perform that action at this time.
0 commit comments