Merge pull request #131173 from zhaofengli/klipper-cfg-list
nixos/klipper: Allow lists as values for gcode_macro
This commit is contained in:
commit
f7e77f65ee
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