---
Function {
 argument: Destructured {
  identifier: None,
  arguments: [
   DestructuredArgument {
    identifier: "lib",
    default: None,
   },
   DestructuredArgument {
    identifier: "config",
    default: None,
   },
   DestructuredArgument {
    identifier: "pkgs",
    default: None,
   },
  ],
  ellipsis: true,
 },
 definition: With {
  expression: Variable {
   identifier: "lib",
   position: (3, 6),
  },
  target: LetIn {
   bindings: [
    Binding {
     from: AttributePath {
      parts: [
       Raw {
        content: "cfg",
        position: (7, 3),
       },
      ],
     },
     to: PropertyAccess {
      expression: Variable {
       identifier: "config",
       position: (7, 9),
      },
      attribute_path: AttributePath {
       parts: [
        Raw {
         content: "services",
         position: (7, 16),
        },
        Raw {
         content: "xmr-stak",
         position: (7, 25),
        },
       ],
      },
      default: None,
     },
    },
    Binding {
     from: AttributePath {
      parts: [
       Raw {
        content: "pkg",
        position: (9, 3),
       },
      ],
     },
     to: FunctionApplication {
      function: PropertyAccess {
       expression: Variable {
        identifier: "pkgs",
        position: (9, 9),
       },
       attribute_path: AttributePath {
        parts: [
         Raw {
          content: "xmr-stak",
          position: (9, 14),
         },
         Raw {
          content: "override",
          position: (9, 23),
         },
        ],
       },
       default: None,
      },
      arguments: [
       Map {
        bindings: [
         Inherit {
          from: Some(
           Variable {
            identifier: "cfg",
            position: (10, 14),
           },
          ),
          attributes: [
           Raw {
            content: "openclSupport",
            position: (10, 19),
           },
           Raw {
            content: "cudaSupport",
            position: (10, 33),
           },
          ],
         },
        ],
        recursive: false,
        position: (9, 32),
       },
      ],
     },
    },
   ],
   target: Map {
    bindings: [
     Binding {
      from: AttributePath {
       parts: [
        Raw {
         content: "options",
         position: (16, 3),
        },
       ],
      },
      to: Map {
       bindings: [
        Binding {
         from: AttributePath {
          parts: [
           Raw {
            content: "services",
            position: (17, 5),
           },
           Raw {
            content: "xmr-stak",
            position: (17, 14),
           },
          ],
         },
         to: Map {
          bindings: [
           Binding {
            from: AttributePath {
             parts: [
              Raw {
               content: "enable",
               position: (18, 7),
              },
             ],
            },
            to: FunctionApplication {
             function: Variable {
              identifier: "mkEnableOption",
              position: (18, 16),
             },
             arguments: [
              String {
               parts: [
                Raw {
                 content: "xmr-stak miner",
                 position: (18, 32),
                },
               ],
               position: (18, 31),
              },
             ],
            },
           },
           Binding {
            from: AttributePath {
             parts: [
              Raw {
               content: "openclSupport",
               position: (19, 7),
              },
             ],
            },
            to: FunctionApplication {
             function: Variable {
              identifier: "mkEnableOption",
              position: (19, 23),
             },
             arguments: [
              String {
               parts: [
                Raw {
                 content: "support for OpenCL (AMD/ATI graphics cards)",
                 position: (19, 39),
                },
               ],
               position: (19, 38),
              },
             ],
            },
           },
           Binding {
            from: AttributePath {
             parts: [
              Raw {
               content: "cudaSupport",
               position: (20, 7),
              },
             ],
            },
            to: FunctionApplication {
             function: Variable {
              identifier: "mkEnableOption",
              position: (20, 21),
             },
             arguments: [
              String {
               parts: [
                Raw {
                 content: "support for CUDA (NVidia graphics cards)",
                 position: (20, 37),
                },
               ],
               position: (20, 36),
              },
             ],
            },
           },
           Binding {
            from: AttributePath {
             parts: [
              Raw {
               content: "extraArgs",
               position: (22, 7),
              },
             ],
            },
            to: FunctionApplication {
             function: Variable {
              identifier: "mkOption",
              position: (22, 19),
             },
             arguments: [
              Map {
               bindings: [
                Binding {
                 from: AttributePath {
                  parts: [
                   Raw {
                    content: "type",
                    position: (23, 9),
                   },
                  ],
                 },
                 to: FunctionApplication {
                  function: PropertyAccess {
                   expression: Variable {
                    identifier: "types",
                    position: (23, 16),
                   },
                   attribute_path: AttributePath {
                    parts: [
                     Raw {
                      content: "listOf",
                      position: (23, 22),
                     },
                    ],
                   },
                   default: None,
                  },
                  arguments: [
                   PropertyAccess {
                    expression: Variable {
                     identifier: "types",
                     position: (23, 29),
                    },
                    attribute_path: AttributePath {
                     parts: [
                      Raw {
                       content: "str",
                       position: (23, 35),
                      },
                     ],
                    },
                    default: None,
                   },
                  ],
                 },
                },
                Binding {
                 from: AttributePath {
                  parts: [
                   Raw {
                    content: "default",
                    position: (24, 9),
                   },
                  ],
                 },
                 to: List {
                  elements: [],
                  position: (24, 19),
                 },
                },
                Binding {
                 from: AttributePath {
                  parts: [
                   Raw {
                    content: "example",
                    position: (25, 9),
                   },
                  ],
                 },
                 to: List {
                  elements: [
                   String {
                    parts: [
                     Raw {
                      content: "--noCPU",
                      position: (25, 22),
                     },
                    ],
                    position: (25, 21),
                   },
                   String {
                    parts: [
                     Raw {
                      content: "--currency monero",
                      position: (25, 32),
                     },
                    ],
                    position: (25, 31),
                   },
                  ],
                  position: (25, 19),
                 },
                },
                Binding {
                 from: AttributePath {
                  parts: [
                   Raw {
                    content: "description",
                    position: (26, 9),
                   },
                  ],
                 },
                 to: String {
                  parts: [
                   Raw {
                    content: "List of parameters to pass to xmr-stak.",
                    position: (26, 24),
                   },
                  ],
                  position: (26, 23),
                 },
                },
               ],
               recursive: false,
               position: (22, 28),
              },
             ],
            },
           },
           Binding {
            from: AttributePath {
             parts: [
              Raw {
               content: "configFiles",
               position: (29, 7),
              },
             ],
            },
            to: FunctionApplication {
             function: Variable {
              identifier: "mkOption",
              position: (29, 21),
             },
             arguments: [
              Map {
               bindings: [
                Binding {
                 from: AttributePath {
                  parts: [
                   Raw {
                    content: "type",
                    position: (30, 9),
                   },
                  ],
                 },
                 to: FunctionApplication {
                  function: PropertyAccess {
                   expression: Variable {
                    identifier: "types",
                    position: (30, 16),
                   },
                   attribute_path: AttributePath {
                    parts: [
                     Raw {
                      content: "attrsOf",
                      position: (30, 22),
                     },
                    ],
                   },
                   default: None,
                  },
                  arguments: [
                   PropertyAccess {
                    expression: Variable {
                     identifier: "types",
                     position: (30, 30),
                    },
                    attribute_path: AttributePath {
                     parts: [
                      Raw {
                       content: "str",
                       position: (30, 36),
                      },
                     ],
                    },
                    default: None,
                   },
                  ],
                 },
                },
                Binding {
                 from: AttributePath {
                  parts: [
                   Raw {
                    content: "default",
                    position: (31, 9),
                   },
                  ],
                 },
                 to: Map {
                  bindings: [],
                  recursive: false,
                  position: (31, 19),
                 },
                },
                Binding {
                 from: AttributePath {
                  parts: [
                   Raw {
                    content: "example",
                    position: (32, 9),
                   },
                  ],
                 },
                 to: FunctionApplication {
                  function: Variable {
                   identifier: "literalExpression",
                   position: (32, 19),
                  },
                  arguments: [
                   String {
                    parts: [
                     Raw {
                      content: "{\n  \"config.txt\" = ",
                      position: (33, 1),
                     },
                     Raw {
                      content: "''",
                      position: (34, 28),
                     },
                     Raw {
                      content: "\n    \"verbose_level\" : 4,\n    \"h_print_time\" : 60,\n    \"tls_secure_algo\" : true,\n  ",
                      position: (34, 31),
                     },
                     Raw {
                      content: "''",
                      position: (38, 13),
                     },
                     Raw {
                      content: ";\n  \"pools.txt\" = ",
                      position: (38, 16),
                     },
                     Raw {
                      content: "''",
                      position: (39, 27),
                     },
                     Raw {
                      content: "\n    \"currency\" : \"monero7\",\n    \"pool_list\" :\n    [ { \"pool_address\" : \"pool.supportxmr.com:443\",\n        \"wallet_address\" : \"my-wallet-address\",\n        \"rig_id\" : \"\",\n        \"pool_password\" : \"nixos\",\n        \"use_nicehash\" : false,\n        \"use_tls\" : true,\n        \"tls_fingerprint\" : \"\",\n        \"pool_weight\" : 23\n      },\n    ],\n  ",
                      position: (39, 30),
                     },
                     Raw {
                      content: "''",
                      position: (52, 13),
                     },
                     Raw {
                      content: ";\n}\n",
                      position: (52, 16),
                     },
                    ],
                    position: (32, 37),
                   },
                  ],
                 },
                },
                Binding {
                 from: AttributePath {
                  parts: [
                   Raw {
                    content: "description",
                    position: (55, 9),
                   },
                  ],
                 },
                 to: String {
                  parts: [
                   Raw {
                    content: "Content of config files like config.txt, pools.txt or cpu.txt.\n",
                    position: (56, 1),
                   },
                  ],
                  position: (55, 23),
                 },
                },
               ],
               recursive: false,
               position: (29, 30),
              },
             ],
            },
           },
          ],
          recursive: false,
          position: (17, 25),
         },
        },
       ],
       recursive: false,
       position: (16, 13),
      },
     },
     Binding {
      from: AttributePath {
       parts: [
        Raw {
         content: "config",
         position: (62, 3),
        },
       ],
      },
      to: FunctionApplication {
       function: Variable {
        identifier: "mkIf",
        position: (62, 12),
       },
       arguments: [
        PropertyAccess {
         expression: Variable {
          identifier: "cfg",
          position: (62, 17),
         },
         attribute_path: AttributePath {
          parts: [
           Raw {
            content: "enable",
            position: (62, 21),
           },
          ],
         },
         default: None,
        },
        Map {
         bindings: [
          Binding {
           from: AttributePath {
            parts: [
             Raw {
              content: "systemd",
              position: (63, 5),
             },
             Raw {
              content: "services",
              position: (63, 13),
             },
             Raw {
              content: "xmr-stak",
              position: (63, 22),
             },
            ],
           },
           to: Map {
            bindings: [
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "wantedBy",
                 position: (64, 7),
                },
               ],
              },
              to: List {
               elements: [
                String {
                 parts: [
                  Raw {
                   content: "multi-user.target",
                   position: (64, 21),
                  },
                 ],
                 position: (64, 20),
                },
               ],
               position: (64, 18),
              },
             },
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "bindsTo",
                 position: (65, 7),
                },
               ],
              },
              to: List {
               elements: [
                String {
                 parts: [
                  Raw {
                   content: "network-online.target",
                   position: (65, 20),
                  },
                 ],
                 position: (65, 19),
                },
               ],
               position: (65, 17),
              },
             },
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "after",
                 position: (66, 7),
                },
               ],
              },
              to: List {
               elements: [
                String {
                 parts: [
                  Raw {
                   content: "network-online.target",
                   position: (66, 18),
                  },
                 ],
                 position: (66, 17),
                },
               ],
               position: (66, 15),
              },
             },
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "environment",
                 position: (67, 7),
                },
               ],
              },
              to: FunctionApplication {
               function: Variable {
                identifier: "mkIf",
                position: (67, 21),
               },
               arguments: [
                PropertyAccess {
                 expression: Variable {
                  identifier: "cfg",
                  position: (67, 26),
                 },
                 attribute_path: AttributePath {
                  parts: [
                   Raw {
                    content: "cudaSupport",
                    position: (67, 30),
                   },
                  ],
                 },
                 default: None,
                },
                Map {
                 bindings: [
                  Binding {
                   from: AttributePath {
                    parts: [
                     Raw {
                      content: "LD_LIBRARY_PATH",
                      position: (68, 9),
                     },
                    ],
                   },
                   to: String {
                    parts: [
                     Interpolation {
                      expression: PropertyAccess {
                       expression: Variable {
                        identifier: "pkgs",
                        position: (68, 30),
                       },
                       attribute_path: AttributePath {
                        parts: [
                         Raw {
                          content: "linuxPackages_latest",
                          position: (68, 35),
                         },
                         Raw {
                          content: "nvidia_x11",
                          position: (68, 56),
                         },
                        ],
                       },
                       default: None,
                      },
                     },
                     Raw {
                      content: "/lib",
                      position: (68, 67),
                     },
                    ],
                    position: (68, 27),
                   },
                  },
                 ],
                 recursive: false,
                 position: (67, 42),
                },
               ],
              },
             },
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "preStart",
                 position: (71, 7),
                },
               ],
              },
              to: FunctionApplication {
               function: Variable {
                identifier: "concatStrings",
                position: (71, 18),
               },
               arguments: [
                Parentheses {
                 expression: FunctionApplication {
                  function: Variable {
                   identifier: "flip",
                   position: (71, 33),
                  },
                  arguments: [
                   Variable {
                    identifier: "mapAttrsToList",
                    position: (71, 38),
                   },
                   PropertyAccess {
                    expression: Variable {
                     identifier: "cfg",
                     position: (71, 53),
                    },
                    attribute_path: AttributePath {
                     parts: [
                      Raw {
                       content: "configFiles",
                       position: (71, 57),
                      },
                     ],
                    },
                    default: None,
                   },
                   Parentheses {
                    expression: Function {
                     argument: Simple {
                      identifier: "fn",
                     },
                     definition: Function {
                      argument: Simple {
                       identifier: "content",
                      },
                      definition: String {
                       parts: [
                        Raw {
                         content: "ln -sf ",
                         position: (72, 1),
                        },
                        Raw {
                         content: "'",
                         position: (72, 16),
                        },
                        Interpolation {
                         expression: FunctionApplication {
                          function: PropertyAccess {
                           expression: Variable {
                            identifier: "pkgs",
                            position: (72, 19),
                           },
                           attribute_path: AttributePath {
                            parts: [
                             Raw {
                              content: "writeText",
                              position: (72, 24),
                             },
                            ],
                           },
                           default: None,
                          },
                          arguments: [
                           String {
                            parts: [
                             Raw {
                              content: "xmr-stak-",
                              position: (72, 35),
                             },
                             Interpolation {
                              expression: Variable {
                               identifier: "fn",
                               position: (72, 46),
                              },
                             },
                            ],
                            position: (72, 34),
                           },
                           Variable {
                            identifier: "content",
                            position: (72, 51),
                           },
                          ],
                         },
                        },
                        Raw {
                         content: "' ",
                         position: (72, 59),
                        },
                        Raw {
                         content: "'",
                         position: (72, 61),
                        },
                        Interpolation {
                         expression: Variable {
                          identifier: "fn",
                          position: (72, 64),
                         },
                        },
                        Raw {
                         content: "'\n",
                         position: (72, 67),
                        },
                       ],
                       position: (71, 83),
                      },
                      position: (71, 74),
                     },
                     position: (71, 70),
                    },
                    position: (71, 69),
                   },
                  ],
                 },
                 position: (71, 32),
                },
               ],
              },
             },
             Binding {
              from: AttributePath {
               parts: [
                Raw {
                 content: "serviceConfig",
                 position: (75, 7),
                },
               ],
              },
              to: LetIn {
               bindings: [
                Binding {
                 from: AttributePath {
                  parts: [
                   Raw {
                    content: "rootRequired",
                    position: (75, 27),
                   },
                  ],
                 },
                 to: BinaryOperation {
                  operator: LogicalOr,
                  operands: [
                   PropertyAccess {
                    expression: Variable {
                     identifier: "cfg",
                     position: (75, 42),
                    },
                    attribute_path: AttributePath {
                     parts: [
                      Raw {
                       content: "openclSupport",
                       position: (75, 46),
                      },
                     ],
                    },
                    default: None,
                   },
                   PropertyAccess {
                    expression: Variable {
                     identifier: "cfg",
                     position: (75, 63),
                    },
                    attribute_path: AttributePath {
                     parts: [
                      Raw {
                       content: "cudaSupport",
                       position: (75, 67),
                      },
                     ],
                    },
                    default: None,
                   },
                  ],
                  position: (75, 60),
                 },
                },
               ],
               target: Map {
                bindings: [
                 Binding {
                  from: AttributePath {
                   parts: [
                    Raw {
                     content: "ExecStart",
                     position: (76, 9),
                    },
                   ],
                  },
                  to: String {
                   parts: [
                    Interpolation {
                     expression: Variable {
                      identifier: "pkg",
                      position: (76, 24),
                     },
                    },
                    Raw {
                     content: "/bin/xmr-stak ",
                     position: (76, 28),
                    },
                    Interpolation {
                     expression: FunctionApplication {
                      function: Variable {
                       identifier: "concatStringsSep",
                       position: (76, 44),
                      },
                      arguments: [
                       String {
                        parts: [
                         Raw {
                          content: " ",
                          position: (76, 62),
                         },
                        ],
                        position: (76, 61),
                       },
                       PropertyAccess {
                        expression: Variable {
                         identifier: "cfg",
                         position: (76, 65),
                        },
                        attribute_path: AttributePath {
                         parts: [
                          Raw {
                           content: "extraArgs",
                           position: (76, 69),
                          },
                         ],
                        },
                        default: None,
                       },
                      ],
                     },
                    },
                   ],
                   position: (76, 21),
                  },
                 },
                 Binding {
                  from: AttributePath {
                   parts: [
                    Raw {
                     content: "WorkingDirectory",
                     position: (78, 9),
                    },
                   ],
                  },
                  to: String {
                   parts: [
                    Raw {
                     content: "/tmp",
                     position: (78, 29),
                    },
                   ],
                   position: (78, 28),
                  },
                 },
                 Binding {
                  from: AttributePath {
                   parts: [
                    Raw {
                     content: "PrivateTmp",
                     position: (79, 9),
                    },
                   ],
                  },
                  to: Variable {
                   identifier: "true",
                   position: (79, 22),
                  },
                 },
                 Binding {
                  from: AttributePath {
                   parts: [
                    Raw {
                     content: "DynamicUser",
                     position: (80, 9),
                    },
                   ],
                  },
                  to: UnaryOperation {
                   operator: Not,
                   operand: Variable {
                    identifier: "rootRequired",
                    position: (80, 24),
                   },
                   position: (80, 23),
                  },
                 },
                 Binding {
                  from: AttributePath {
                   parts: [
                    Raw {
                     content: "LimitMEMLOCK",
                     position: (81, 9),
                    },
                   ],
                  },
                  to: FunctionApplication {
                   function: Variable {
                    identifier: "toString",
                    position: (81, 24),
                   },
                   arguments: [
                    Parentheses {
                     expression: BinaryOperation {
                      operator: Multiplication,
                      operands: [
                       Int {
                        value: 1024,
                        position: (81, 34),
                       },
                       Int {
                        value: 1024,
                        position: (81, 39),
                       },
                      ],
                      position: (81, 38),
                     },
                     position: (81, 33),
                    },
                   ],
                  },
                 },
                ],
                recursive: false,
                position: (75, 83),
               },
               position: (75, 23),
              },
             },
            ],
            recursive: false,
            position: (63, 33),
           },
          },
         ],
         recursive: false,
         position: (62, 28),
        },
       ],
      },
     },
     Binding {
      from: AttributePath {
       parts: [
        Raw {
         content: "imports",
         position: (86, 3),
        },
       ],
      },
      to: List {
       elements: [
        Parentheses {
         expression: FunctionApplication {
          function: Variable {
           identifier: "mkRemovedOptionModule",
           position: (87, 6),
          },
          arguments: [
           List {
            elements: [
             String {
              parts: [
               Raw {
                content: "services",
                position: (87, 30),
               },
              ],
              position: (87, 29),
             },
             String {
              parts: [
               Raw {
                content: "xmr-stak",
                position: (87, 41),
               },
              ],
              position: (87, 40),
             },
             String {
              parts: [
               Raw {
                content: "configText",
                position: (87, 52),
               },
              ],
              position: (87, 51),
             },
            ],
            position: (87, 28),
           },
           String {
            parts: [
             Raw {
              content: "This option was removed in favour of `services.xmr-stak.configFiles`\nbecause the new config file `pools.txt` was introduced. You are\nnow able to define all other config files like cpu.txt or amd.txt.\n",
              position: (88, 1),
             },
            ],
            position: (87, 65),
           },
          ],
         },
         position: (87, 5),
        },
       ],
       position: (86, 13),
      },
     },
    ],
    recursive: false,
    position: (15, 1),
   },
   position: (5, 1),
  },
  position: (3, 1),
 },
 position: (1, 1),
}