---
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: (6, 6),
  },
  target: LetIn {
   bindings: [
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "nixpkgs",
        position: (9, 3),
       },
      ],
     },
     FunctionApplication {
      function: PropertyAccess {
       expression: Variable {
        identifier: "lib",
        position: (9, 13),
       },
       attribute_path: AttributePath {
        attributes: [
         Raw {
          content: "cleanSource",
          position: (9, 17),
         },
        ],
       },
       default: None,
      },
      arguments: [
       PropertyAccess {
        expression: Variable {
         identifier: "pkgs",
         position: (9, 29),
        },
        attribute_path: AttributePath {
         attributes: [
          Raw {
           content: "path",
           position: (9, 34),
          },
         ],
        },
        default: None,
       },
      ],
     },
    ),
    KeyValue(
     AttributePath {
      attributes: [
       Raw {
        content: "channelSources",
        position: (15, 3),
       },
      ],
     },
     FunctionApplication {
      function: PropertyAccess {
       expression: Variable {
        identifier: "pkgs",
        position: (15, 20),
       },
       attribute_path: AttributePath {
        attributes: [
         Raw {
          content: "runCommand",
          position: (15, 25),
         },
        ],
       },
       default: None,
      },
      arguments: [
       String {
        parts: [
         Raw {
          content: "nixos-",
          position: (15, 37),
         },
         Expression {
          expression: PropertyAccess {
           expression: Variable {
            identifier: "config",
            position: (15, 45),
           },
           attribute_path: AttributePath {
            attributes: [
             Raw {
              content: "system",
              position: (15, 52),
             },
             Raw {
              content: "nixos",
              position: (15, 59),
             },
             Raw {
              content: "version",
              position: (15, 65),
             },
            ],
           },
           default: None,
          },
         },
        ],
       },
       Map {
        bindings: [
         KeyValue(
          AttributePath {
           attributes: [
            Raw {
             content: "preferLocalBuild",
             position: (16, 7),
            },
           ],
          },
          Variable {
           identifier: "true",
           position: (16, 26),
          },
         ),
        ],
        recursive: false,
        position: (16, 5),
       },
       String {
        parts: [
         Raw {
          content: "mkdir -p $out\ncp -prd ",
          position: (18, 1),
         },
         Expression {
          expression: PropertyAccess {
           expression: Variable {
            identifier: "nixpkgs",
            position: (19, 17),
           },
           attribute_path: AttributePath {
            attributes: [
             Raw {
              content: "outPath",
              position: (19, 25),
             },
            ],
           },
           default: None,
          },
         },
         Raw {
          content: " $out/nixos\nchmod -R u+w $out/nixos\nif [ ! -e $out/nixos/nixpkgs ]; then\n  ln -s . $out/nixos/nixpkgs\nfi\n",
          position: (19, 33),
         },
         Expression {
          expression: FunctionApplication {
           function: Variable {
            identifier: "optionalString",
            position: (24, 9),
           },
           arguments: [
            BinaryOperation {
             operator: NotEqualTo,
             operands: [
              PropertyAccess {
               expression: Variable {
                identifier: "config",
                position: (24, 25),
               },
               attribute_path: AttributePath {
                attributes: [
                 Raw {
                  content: "system",
                  position: (24, 32),
                 },
                 Raw {
                  content: "nixos",
                  position: (24, 39),
                 },
                 Raw {
                  content: "revision",
                  position: (24, 45),
                 },
                ],
               },
               default: None,
              },
              Variable {
               identifier: "null",
               position: (24, 57),
              },
             ],
             position: (24, 54),
            },
            String {
             parts: [
              Raw {
               content: "echo -n ",
               position: (25, 1),
              },
              Expression {
               expression: PropertyAccess {
                expression: Variable {
                 identifier: "config",
                 position: (25, 19),
                },
                attribute_path: AttributePath {
                 attributes: [
                  Raw {
                   content: "system",
                   position: (25, 26),
                  },
                  Raw {
                   content: "nixos",
                   position: (25, 33),
                  },
                  Raw {
                   content: "revision",
                   position: (25, 39),
                  },
                 ],
                },
                default: None,
               },
              },
              Raw {
               content: " > $out/nixos/.git-revision\n",
               position: (25, 48),
              },
             ],
            },
           ],
          },
         },
         Raw {
          content: "\necho -n ",
          position: (26, 10),
         },
         Expression {
          expression: PropertyAccess {
           expression: Variable {
            identifier: "config",
            position: (27, 17),
           },
           attribute_path: AttributePath {
            attributes: [
             Raw {
              content: "system",
              position: (27, 24),
             },
             Raw {
              content: "nixos",
              position: (27, 31),
             },
             Raw {
              content: "versionSuffix",
              position: (27, 37),
             },
            ],
           },
           default: None,
          },
         },
         Raw {
          content: " > $out/nixos/.version-suffix\necho ",
          position: (27, 51),
         },
         Expression {
          expression: PropertyAccess {
           expression: Variable {
            identifier: "config",
            position: (28, 14),
           },
           attribute_path: AttributePath {
            attributes: [
             Raw {
              content: "system",
              position: (28, 21),
             },
             Raw {
              content: "nixos",
              position: (28, 28),
             },
             Raw {
              content: "versionSuffix",
              position: (28, 34),
             },
            ],
           },
           default: None,
          },
         },
         Raw {
          content: " | sed -e s/pre// > $out/nixos/svn-revision\n",
          position: (28, 48),
         },
        ],
       },
      ],
     },
    ),
   ],
   target: Map {
    bindings: [
     KeyValue(
      AttributePath {
       attributes: [
        Raw {
         content: "boot",
         position: (36, 3),
        },
        Raw {
         content: "postBootCommands",
         position: (36, 8),
        },
       ],
      },
      FunctionApplication {
       function: Variable {
        identifier: "mkAfter",
        position: (36, 27),
       },
       arguments: [
        String {
         parts: [
          Raw {
           content: "if ! [ -e /var/lib/nixos/did-channel-init ]; then\n  echo \"unpacking the NixOS/Nixpkgs sources...\"\n  mkdir -p /nix/var/nix/profiles/per-user/root\n  ",
           position: (38, 1),
          },
          Expression {
           expression: PropertyAccess {
            expression: Variable {
             identifier: "config",
             position: (41, 11),
            },
            attribute_path: AttributePath {
             attributes: [
              Raw {
               content: "nix",
               position: (41, 18),
              },
              Raw {
               content: "package",
               position: (41, 22),
              },
              Raw {
               content: "out",
               position: (41, 30),
              },
             ],
            },
            default: None,
           },
          },
          Raw {
           content: "/bin/nix-env -p /nix/var/nix/profiles/per-user/root/channels \\\n    -i ",
           position: (41, 34),
          },
          Expression {
           expression: Variable {
            identifier: "channelSources",
            position: (42, 16),
           },
          },
          Raw {
           content: " --quiet --option build-use-substitutes false\n  mkdir -m 0700 -p /root/.nix-defexpr\n  ln -s /nix/var/nix/profiles/per-user/root/channels /root/.nix-defexpr/channels\n  mkdir -m 0755 -p /var/lib/nixos\n  touch /var/lib/nixos/did-channel-init\nfi\n",
           position: (42, 31),
          },
         ],
        },
       ],
      },
     ),
    ],
    recursive: false,
    position: (33, 1),
   },
   position: (8, 1),
  },
  position: (6, 1),
 },
 position: (4, 1),
}