git.iko.soy/typeable/nixpkgs
on master help sign in
nixos/snapserver: fix argument handling.

The argument parser used by snapserver behaves differntly for optional arguments with existing defaults. In such cases, the standalone argument name is a valid input and a following value is interpreted as a positional argument. Therefore the argument and the value must be provided as a single argument seperated by equals sign.

commitec10d9a836079d181ad2acb191b9d1a40a498024 authorDustin Frisch <fooker@lab.sh> dateThu 24 Feb 2022, 23:06 (5 years ago) parentd013bba
1 file changed+13−13
nixos/modules/services/audio/snapserver.nix+13−13
nixos/modules/services/audio/snapserver.nix+13−13
@@ -44,24 +44,24 @@ let
4444
4545 optionString = concatStringsSep " " (mapAttrsToList streamToOption cfg.streams
4646 # global options
47− ++ [ "--stream.bind_to_address ${cfg.listenAddress}" ]
48− ++ [ "--stream.port ${toString cfg.port}" ]
49− ++ optionalNull cfg.sampleFormat "--stream.sampleformat ${cfg.sampleFormat}"
50− ++ optionalNull cfg.codec "--stream.codec ${cfg.codec}"
51− ++ optionalNull cfg.streamBuffer "--stream.stream_buffer ${toString cfg.streamBuffer}"
52− ++ optionalNull cfg.buffer "--stream.buffer ${toString cfg.buffer}"
47+ ++ [ "--stream.bind_to_address=${cfg.listenAddress}" ]
48+ ++ [ "--stream.port=${toString cfg.port}" ]
49+ ++ optionalNull cfg.sampleFormat "--stream.sampleformat=${cfg.sampleFormat}"
50+ ++ optionalNull cfg.codec "--stream.codec=${cfg.codec}"
51+ ++ optionalNull cfg.streamBuffer "--stream.stream_buffer=${toString cfg.streamBuffer}"
52+ ++ optionalNull cfg.buffer "--stream.buffer=${toString cfg.buffer}"
5353 ++ optional cfg.sendToMuted "--stream.send_to_muted"
5454 # tcp json rpc
55− ++ [ "--tcp.enabled ${toString cfg.tcp.enable}" ]
55+ ++ [ "--tcp.enabled=${toString cfg.tcp.enable}" ]
5656 ++ optionals cfg.tcp.enable [
57− "--tcp.bind_to_address ${cfg.tcp.listenAddress}"
58− "--tcp.port ${toString cfg.tcp.port}" ]
57+ "--tcp.bind_to_address=${cfg.tcp.listenAddress}"
58+ "--tcp.port=${toString cfg.tcp.port}" ]
5959 # http json rpc
60− ++ [ "--http.enabled ${toString cfg.http.enable}" ]
60+ ++ [ "--http.enabled=${toString cfg.http.enable}" ]
6161 ++ optionals cfg.http.enable [
62− "--http.bind_to_address ${cfg.http.listenAddress}"
63− "--http.port ${toString cfg.http.port}"
64− ] ++ optional (cfg.http.docRoot != null) "--http.doc_root \"${toString cfg.http.docRoot}\"");
62+ "--http.bind_to_address=${cfg.http.listenAddress}"
63+ "--http.port=${toString cfg.http.port}"
64+ ] ++ optional (cfg.http.docRoot != null) "--http.doc_root=\"${toString cfg.http.docRoot}\"");
6565
6666in {
6767 imports = [