File tree Expand file tree Collapse file tree 2 files changed +81
-0
lines changed
Expand file tree Collapse file tree 2 files changed +81
-0
lines changed Original file line number Diff line number Diff line change 1+ {
2+ pkgs ,
3+ self ,
4+ } :
5+
6+ let
7+ swayosdWrapped =
8+ ( self . wrapperModules . swayosd . apply {
9+ inherit pkgs ;
10+
11+ settings = {
12+ server = {
13+ max_volume = 150 ;
14+ min_brightness = 5 ;
15+ } ;
16+ } ;
17+ } ) . wrapper ;
18+
19+ in
20+ pkgs . runCommand "swayosd-test" { } ''
21+ test -x "${ swayosdWrapped } /bin/swayosd-server"
22+
23+ touch $out
24+ ''
Original file line number Diff line number Diff line change 1+ {
2+ config ,
3+ lib ,
4+ wlib ,
5+ ...
6+ } :
7+ let
8+ tomlFmt = config . pkgs . formats . toml { } ;
9+ in
10+ {
11+ _class = "wrapper" ;
12+ options = {
13+ settings = lib . mkOption {
14+ type = tomlFmt . type ;
15+ default = { } ;
16+ description = ''
17+ SwayOSD server configuration.
18+ See https://github.com/ErikReider/SwayOSD for available options.
19+ '' ;
20+ example = lib . literalExpression ''
21+ {
22+ server = {
23+ max_volume = 150;
24+ min_brightness = 5;
25+ top_margin = 0.85;
26+ show_percentage = true;
27+ };
28+ }
29+ '' ;
30+ } ;
31+ "config.toml" = lib . mkOption {
32+ type = wlib . types . file config . pkgs ;
33+ default . path = tomlFmt . generate "config.toml" config . settings ;
34+ description = "Generated SwayOSD configuration file." ;
35+ } ;
36+ style = lib . mkOption {
37+ type = wlib . types . file config . pkgs ;
38+ default . content = "" ;
39+ description = ''
40+ CSS stylesheet for SwayOSD appearance.
41+ See the SwayOSD repository for styling examples.
42+ '' ;
43+ } ;
44+ } ;
45+
46+ config . flags = {
47+ "--config" = "${ config . "config.toml" . path } " ;
48+ "--style" = if ( config . style . content != "" ) then "${ config . style . path } " else false ;
49+ } ;
50+
51+ config . exePath = lib . getExe' config . pkgs . swayosd "swayosd-server" ;
52+
53+ config . package = config . pkgs . swayosd ;
54+
55+ config . meta . maintainers = [ lib . maintainers . adeci ] ;
56+ config . meta . platforms = lib . platforms . linux ;
57+ }
You can’t perform that action at this time.
0 commit comments