File tree Expand file tree Collapse file tree
nixos/modules/services/misc Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22 config ,
33 lib ,
44 pkgs ,
5+ utils ,
56 ...
67} :
78let
1112 documentationLink = "https://manual.calibre-ebook.com" ;
1213 generatedDocumentationLink = documentationLink + "/generated/en/calibre-server.html" ;
1314
14- execFlags = (
15- lib . concatStringsSep " " (
16- lib . mapAttrsToList ( k : v : "${ k } ${ toString v } " ) (
17- lib . filterAttrs ( name : value : value != null ) {
18- "--listen-on" = cfg . host ;
19- "--port" = cfg . port ;
20- "--auth-mode" = cfg . auth . mode ;
21- "--userdb" = cfg . auth . userDb ;
22- }
23- )
24- ++ [ ( lib . optionalString ( cfg . auth . enable == true ) "--enable-auth" ) ]
25- ++ cfg . extraFlags
15+ execFlags =
16+ lib . mapAttrsToList ( k : v : "--${ k } =${ toString v } " ) (
17+ lib . filterAttrs ( name : value : value != null ) {
18+ listen-on = cfg . host ;
19+ port = cfg . port ;
20+ auth-mode = cfg . auth . mode ;
21+ userdb = cfg . auth . userDb ;
22+ }
2623 )
27- ) ;
24+ ++ lib . optional cfg . auth . enable "--enable-auth"
25+ ++ cfg . extraFlags ;
2826in
2927
3028{
150148 serviceConfig = {
151149 User = cfg . user ;
152150 Restart = "always" ;
153- ExecStart = "${ cfg . package } /bin/calibre-server ${ lib . concatStringsSep " " cfg . libraries } ${ execFlags } " ;
151+ ExecStart = utils . escapeSystemdExecArgs (
152+ [ "${ cfg . package } /bin/calibre-server" ] ++ execFlags ++ [ "--" ] ++ cfg . libraries
153+ ) ;
154154 } ;
155155
156156 } ;
You can’t perform that action at this time.
0 commit comments