{ url ? null, hash ? null, pkgs, lib, ... }: let modpack = pkgs.fetchzip { inherit url hash; stripRoot = false; }; variablesStr = builtins.readFile "${modpack}/variables.txt"; variableLines = builtins.filter (l: l != "" && (lib.strings.elemAt (lib.stringToCharacters l) 0) != "#") (lib.strings.splitString "\n" variablesStr); stripQuotes = s: if builtins.match "^\".*\"$" s != null then builtins.substring 1 (builtins.stringLength s - 2) s else s; parseLine = line: let parts = lib.strings.splitString "=" line; in { name = builtins.elemAt parts 0; value = stripQuotes (builtins.concatStringsSep "=" (builtins.tail parts)); }; variables = builtins.listToAttrs (map parseLine variableLines); in { inherit variables; root = modpack; mods = "${modpack}/mods"; config = "${modpack}/config"; }