nixos/klipper: Allow lists as values for gcode_macro
This commit is contained in:
parent
3af210329f
commit
34d2b83291
1 changed files with 7 additions and 1 deletions
|
@ -2,7 +2,13 @@
|
|||
with lib;
|
||||
let
|
||||
cfg = config.services.klipper;
|
||||
format = pkgs.formats.ini { mkKeyValue = generators.mkKeyValueDefault {} ":"; };
|
||||
format = pkgs.formats.ini {
|
||||
# https://github.com/NixOS/nixpkgs/pull/121613#issuecomment-885241996
|
||||
listToValue = l:
|
||||
if builtins.length l == 1 then generators.mkValueStringDefault {} (head l)
|
||||
else lib.concatMapStrings (s: "\n ${generators.mkValueStringDefault {} s}") l;
|
||||
mkKeyValue = generators.mkKeyValueDefault {} ":";
|
||||
};
|
||||
in
|
||||
{
|
||||
##### interface
|
||||
|
|
Loading…
Reference in a new issue