---
Function {
 argument: None,
 arguments: FunctionArguments {
  arguments: [
   FunctionArgument {
    identifier: "pkgs",
    default: None,
   },
   FunctionArgument {
    identifier: "lib",
    default: None,
   },
   FunctionArgument {
    identifier: "config",
    default: None,
   },
  ],
  ellipsis: true,
 },
 definition: With {
  expression: Variable {
   identifier: "lib",
   position: (3, 6),
  },
  target: LetIn {
   bindings: [
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "cfg",
        position: (6, 3),
       },
      ],
     },
     PropertyAccess {
      expression: Variable {
       identifier: "config",
       position: (6, 9),
      },
      attribute_path: AttributePath {
       attributes: [
        Raw {
         content: "services",
         position: (6, 16),
        },
        Raw {
         content: "vdr",
         position: (6, 25),
        },
       ],
      },
      default: None,
     },
    ),
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "libDir",
        position: (7, 3),
       },
      ],
     },
     String {
      parts: [
       Raw {
        content: "/var/lib/vdr",
        position: (7, 13),
       },
      ],
     },
    ),
   ],
   target: Map {
    bindings: [
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "options",
         position: (12, 3),
        },
       ],
      },
      Map {
       bindings: [
        KeyValue(
         AttributePath {
          attributes: [
           Raw {
            content: "services",
            position: (14, 5),
           },
           Raw {
            content: "vdr",
            position: (14, 14),
           },
          ],
         },
         Map {
          bindings: [
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "enable",
               position: (15, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkEnableOption",
              position: (15, 16),
             },
             arguments: [
              String {
               parts: [
                Raw {
                 content: "VDR. Please put config into ",
                 position: (15, 32),
                },
                Expression {
                 expression: Variable {
                  identifier: "libDir",
                  position: (15, 62),
                 },
                },
               ],
              },
             ],
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "package",
               position: (17, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkOption",
              position: (17, 17),
             },
             arguments: [
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "type",
                    position: (18, 9),
                   },
                  ],
                 },
                 PropertyAccess {
                  expression: Variable {
                   identifier: "types",
                   position: (18, 16),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "package",
                     position: (18, 22),
                    },
                   ],
                  },
                  default: None,
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "default",
                    position: (19, 9),
                   },
                  ],
                 },
                 PropertyAccess {
                  expression: Variable {
                   identifier: "pkgs",
                   position: (19, 19),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "vdr",
                     position: (19, 24),
                    },
                   ],
                  },
                  default: None,
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "defaultText",
                    position: (20, 9),
                   },
                  ],
                 },
                 FunctionApplication {
                  function: Variable {
                   identifier: "literalExpression",
                   position: (20, 23),
                  },
                  arguments: [
                   String {
                    parts: [
                     Raw {
                      content: "pkgs.vdr",
                      position: (20, 42),
                     },
                    ],
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "example",
                    position: (21, 9),
                   },
                  ],
                 },
                 FunctionApplication {
                  function: Variable {
                   identifier: "literalExpression",
                   position: (21, 19),
                  },
                  arguments: [
                   String {
                    parts: [
                     Raw {
                      content: "pkgs.wrapVdr.override { plugins = with pkgs.vdrPlugins; [ hello ]; }",
                      position: (21, 38),
                     },
                    ],
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "description",
                    position: (22, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "Package to use.",
                    position: (22, 24),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (17, 26),
              },
             ],
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "videoDir",
               position: (25, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkOption",
              position: (25, 18),
             },
             arguments: [
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "type",
                    position: (26, 9),
                   },
                  ],
                 },
                 PropertyAccess {
                  expression: Variable {
                   identifier: "types",
                   position: (26, 16),
                  },
                  attribute_path: AttributePath {
                   attributes: [
                    Raw {
                     content: "path",
                     position: (26, 22),
                    },
                   ],
                  },
                  default: None,
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "default",
                    position: (27, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "/srv/vdr/video",
                    position: (27, 20),
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "description",
                    position: (28, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "Recording directory",
                    position: (28, 24),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (25, 27),
              },
             ],
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "extraArguments",
               position: (31, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkOption",
              position: (31, 24),
             },
             arguments: [
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "type",
                    position: (32, 9),
                   },
                  ],
                 },
                 FunctionApplication {
                  function: PropertyAccess {
                   expression: Variable {
                    identifier: "types",
                    position: (32, 16),
                   },
                   attribute_path: AttributePath {
                    attributes: [
                     Raw {
                      content: "listOf",
                      position: (32, 22),
                     },
                    ],
                   },
                   default: None,
                  },
                  arguments: [
                   PropertyAccess {
                    expression: Variable {
                     identifier: "types",
                     position: (32, 29),
                    },
                    attribute_path: AttributePath {
                     attributes: [
                      Raw {
                       content: "str",
                       position: (32, 35),
                      },
                     ],
                    },
                    default: None,
                   },
                  ],
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "default",
                    position: (33, 9),
                   },
                  ],
                 },
                 List {
                  elements: [],
                  position: (33, 19),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "description",
                    position: (34, 9),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "Additional command line arguments to pass to VDR.",
                    position: (34, 24),
                   },
                  ],
                 },
                ),
               ],
               recursive: false,
               position: (31, 33),
              },
             ],
            },
           ),
           KeyValue(
            AttributePath {
             attributes: [
              Raw {
               content: "enableLirc",
               position: (37, 7),
              },
             ],
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkEnableOption",
              position: (37, 20),
             },
             arguments: [
              String {
               parts: [
                Raw {
                 content: "LIRC",
                 position: (37, 36),
                },
               ],
              },
             ],
            },
           ),
          ],
          recursive: false,
          position: (14, 20),
         },
        ),
       ],
       recursive: false,
       position: (12, 13),
      },
     ),
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "config",
         position: (43, 3),
        },
       ],
      },
      FunctionApplication {
       function: Variable {
        identifier: "mkIf",
        position: (43, 12),
       },
       arguments: [
        PropertyAccess {
         expression: Variable {
          identifier: "cfg",
          position: (43, 17),
         },
         attribute_path: AttributePath {
          attributes: [
           Raw {
            content: "enable",
            position: (43, 21),
           },
          ],
         },
         default: None,
        },
        FunctionApplication {
         function: Variable {
          identifier: "mkMerge",
          position: (43, 29),
         },
         arguments: [
          List {
           elements: [
            Map {
             bindings: [
              KeyValue(
               AttributePath {
                attributes: [
                 Raw {
                  content: "systemd",
                  position: (44, 5),
                 },
                 Raw {
                  content: "tmpfiles",
                  position: (44, 13),
                 },
                 Raw {
                  content: "rules",
                  position: (44, 22),
                 },
                ],
               },
               List {
                elements: [
                 String {
                  parts: [
                   Raw {
                    content: "d ",
                    position: (45, 8),
                   },
                   Expression {
                    expression: PropertyAccess {
                     expression: Variable {
                      identifier: "cfg",
                      position: (45, 12),
                     },
                     attribute_path: AttributePath {
                      attributes: [
                       Raw {
                        content: "videoDir",
                        position: (45, 16),
                       },
                      ],
                     },
                     default: None,
                    },
                   },
                   Raw {
                    content: " 0755 vdr vdr -",
                    position: (45, 25),
                   },
                  ],
                 },
                 String {
                  parts: [
                   Raw {
                    content: "Z ",
                    position: (46, 8),
                   },
                   Expression {
                    expression: PropertyAccess {
                     expression: Variable {
                      identifier: "cfg",
                      position: (46, 12),
                     },
                     attribute_path: AttributePath {
                      attributes: [
                       Raw {
                        content: "videoDir",
                        position: (46, 16),
                       },
                      ],
                     },
                     default: None,
                    },
                   },
                   Raw {
                    content: " - vdr vdr -",
                    position: (46, 25),
                   },
                  ],
                 },
                ],
                position: (44, 30),
               },
              ),
              KeyValue(
               AttributePath {
                attributes: [
                 Raw {
                  content: "systemd",
                  position: (49, 5),
                 },
                 Raw {
                  content: "services",
                  position: (49, 13),
                 },
                 Raw {
                  content: "vdr",
                  position: (49, 22),
                 },
                ],
               },
               Map {
                bindings: [
                 KeyValue(
                  AttributePath {
                   attributes: [
                    Raw {
                     content: "description",
                     position: (50, 7),
                    },
                   ],
                  },
                  String {
                   parts: [
                    Raw {
                     content: "VDR",
                     position: (50, 22),
                    },
                   ],
                  },
                 ),
                 KeyValue(
                  AttributePath {
                   attributes: [
                    Raw {
                     content: "wantedBy",
                     position: (51, 7),
                    },
                   ],
                  },
                  List {
                   elements: [
                    String {
                     parts: [
                      Raw {
                       content: "multi-user.target",
                       position: (51, 21),
                      },
                     ],
                    },
                   ],
                   position: (51, 18),
                  },
                 ),
                 KeyValue(
                  AttributePath {
                   attributes: [
                    Raw {
                     content: "serviceConfig",
                     position: (52, 7),
                    },
                   ],
                  },
                  Map {
                   bindings: [
                    KeyValue(
                     AttributePath {
                      attributes: [
                       Raw {
                        content: "ExecStart",
                        position: (53, 9),
                       },
                      ],
                     },
                     String {
                      parts: [
                       Raw {
                        content: "",
                        position: (54, 1),
                       },
                       Expression {
                        expression: PropertyAccess {
                         expression: Variable {
                          identifier: "cfg",
                          position: (54, 13),
                         },
                         attribute_path: AttributePath {
                          attributes: [
                           Raw {
                            content: "package",
                            position: (54, 17),
                           },
                          ],
                         },
                         default: None,
                        },
                       },
                       Raw {
                        content: "/bin/vdr \\\n  --video=\"",
                        position: (54, 25),
                       },
                       Expression {
                        expression: PropertyAccess {
                         expression: Variable {
                          identifier: "cfg",
                          position: (55, 24),
                         },
                         attribute_path: AttributePath {
                          attributes: [
                           Raw {
                            content: "videoDir",
                            position: (55, 28),
                           },
                          ],
                         },
                         default: None,
                        },
                       },
                       Raw {
                        content: "\" \\\n  --config=\"",
                        position: (55, 37),
                       },
                       Expression {
                        expression: Variable {
                         identifier: "libDir",
                         position: (56, 25),
                        },
                       },
                       Raw {
                        content: "\" \\\n  ",
                        position: (56, 32),
                       },
                       Expression {
                        expression: FunctionApplication {
                         function: Variable {
                          identifier: "escapeShellArgs",
                          position: (57, 15),
                         },
                         arguments: [
                          PropertyAccess {
                           expression: Variable {
                            identifier: "cfg",
                            position: (57, 31),
                           },
                           attribute_path: AttributePath {
                            attributes: [
                             Raw {
                              content: "extraArguments",
                              position: (57, 35),
                             },
                            ],
                           },
                           default: None,
                          },
                         ],
                        },
                       },
                       Raw {
                        content: "\n",
                        position: (57, 50),
                       },
                      ],
                     },
                    ),
                    KeyValue(
                     AttributePath {
                      attributes: [
                       Raw {
                        content: "User",
                        position: (59, 9),
                       },
                      ],
                     },
                     String {
                      parts: [
                       Raw {
                        content: "vdr",
                        position: (59, 17),
                       },
                      ],
                     },
                    ),
                    KeyValue(
                     AttributePath {
                      attributes: [
                       Raw {
                        content: "CacheDirectory",
                        position: (60, 9),
                       },
                      ],
                     },
                     String {
                      parts: [
                       Raw {
                        content: "vdr",
                        position: (60, 27),
                       },
                      ],
                     },
                    ),
                    KeyValue(
                     AttributePath {
                      attributes: [
                       Raw {
                        content: "StateDirectory",
                        position: (61, 9),
                       },
                      ],
                     },
                     String {
                      parts: [
                       Raw {
                        content: "vdr",
                        position: (61, 27),
                       },
                      ],
                     },
                    ),
                    KeyValue(
                     AttributePath {
                      attributes: [
                       Raw {
                        content: "Restart",
                        position: (62, 9),
                       },
                      ],
                     },
                     String {
                      parts: [
                       Raw {
                        content: "on-failure",
                        position: (62, 20),
                       },
                      ],
                     },
                    ),
                   ],
                   recursive: false,
                   position: (52, 23),
                  },
                 ),
                ],
                recursive: false,
                position: (49, 28),
               },
              ),
              KeyValue(
               AttributePath {
                attributes: [
                 Raw {
                  content: "users",
                  position: (66, 5),
                 },
                 Raw {
                  content: "users",
                  position: (66, 11),
                 },
                 Raw {
                  content: "vdr",
                  position: (66, 17),
                 },
                ],
               },
               Map {
                bindings: [
                 KeyValue(
                  AttributePath {
                   attributes: [
                    Raw {
                     content: "group",
                     position: (67, 7),
                    },
                   ],
                  },
                  String {
                   parts: [
                    Raw {
                     content: "vdr",
                     position: (67, 16),
                    },
                   ],
                  },
                 ),
                 KeyValue(
                  AttributePath {
                   attributes: [
                    Raw {
                     content: "home",
                     position: (68, 7),
                    },
                   ],
                  },
                  Variable {
                   identifier: "libDir",
                   position: (68, 14),
                  },
                 ),
                 KeyValue(
                  AttributePath {
                   attributes: [
                    Raw {
                     content: "isSystemUser",
                     position: (69, 7),
                    },
                   ],
                  },
                  Variable {
                   identifier: "true",
                   position: (69, 22),
                  },
                 ),
                ],
                recursive: false,
                position: (66, 23),
               },
              ),
              KeyValue(
               AttributePath {
                attributes: [
                 Raw {
                  content: "users",
                  position: (72, 5),
                 },
                 Raw {
                  content: "groups",
                  position: (72, 11),
                 },
                 Raw {
                  content: "vdr",
                  position: (72, 18),
                 },
                ],
               },
               Map {
                bindings: [],
                recursive: false,
                position: (72, 24),
               },
              ),
             ],
             recursive: false,
             position: (43, 38),
            },
            FunctionApplication {
             function: Variable {
              identifier: "mkIf",
              position: (75, 4),
             },
             arguments: [
              PropertyAccess {
               expression: Variable {
                identifier: "cfg",
                position: (75, 9),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "enableLirc",
                  position: (75, 13),
                 },
                ],
               },
               default: None,
              },
              Map {
               bindings: [
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "services",
                    position: (76, 5),
                   },
                   Raw {
                    content: "lirc",
                    position: (76, 14),
                   },
                   Raw {
                    content: "enable",
                    position: (76, 19),
                   },
                  ],
                 },
                 Variable {
                  identifier: "true",
                  position: (76, 28),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "users",
                    position: (77, 5),
                   },
                   Raw {
                    content: "users",
                    position: (77, 11),
                   },
                   Raw {
                    content: "vdr",
                    position: (77, 17),
                   },
                   Raw {
                    content: "extraGroups",
                    position: (77, 21),
                   },
                  ],
                 },
                 List {
                  elements: [
                   String {
                    parts: [
                     Raw {
                      content: "lirc",
                      position: (77, 38),
                     },
                    ],
                   },
                  ],
                  position: (77, 35),
                 },
                ),
                KeyValue(
                 AttributePath {
                  attributes: [
                   Raw {
                    content: "services",
                    position: (78, 5),
                   },
                   Raw {
                    content: "vdr",
                    position: (78, 14),
                   },
                   Raw {
                    content: "extraArguments",
                    position: (78, 18),
                   },
                  ],
                 },
                 List {
                  elements: [
                   String {
                    parts: [
                     Raw {
                      content: "--lirc=",
                      position: (79, 8),
                     },
                     Expression {
                      expression: PropertyAccess {
                       expression: Variable {
                        identifier: "config",
                        position: (79, 17),
                       },
                       attribute_path: AttributePath {
                        attributes: [
                         Raw {
                          content: "passthru",
                          position: (79, 24),
                         },
                         Raw {
                          content: "lirc",
                          position: (79, 33),
                         },
                         Raw {
                          content: "socket",
                          position: (79, 38),
                         },
                        ],
                       },
                       default: None,
                      },
                     },
                    ],
                   },
                  ],
                  position: (78, 35),
                 },
                ),
               ],
               recursive: false,
               position: (75, 24),
              },
             ],
            },
           ],
           position: (43, 37),
          },
         ],
        },
       ],
      },
     ),
    ],
    recursive: false,
    position: (8, 4),
   },
   position: (5, 1),
  },
  position: (3, 1),
 },
 position: (1, 1),
}