nix-minecraft icon indicating copy to clipboard operation
nix-minecraft copied to clipboard

Ftb fails with no url attribute set, and hashes are confusing.

Open werner291 opened this issue 1 year ago • 1 comments

Hi there,

This flake does not build:

{
  inputs.nix-minecraft.url = "github:12Boti/nix-minecraft";

  outputs =
    { self
    , nixpkgs
    , nix-minecraft
    }:
    {
      defaultPackage.x86_64-linux = nix-minecraft.lib.x86_64-linux.mkMinecraft {
        username = "USERNAME";
        gamedir = "./gamedir";
        minecraft.version = "1.16.5";
        
        modpack.ftb = {
          id = 91;
          version = 6495;
          hash = "sha256-cmnV8ZkV+FkXSkJcj2ML5iIjIiTP5OS6cwM50yooZks=";
        };
        
        forge.hash = "sha256-JNZwW63f02hIv5rJ8P8y2VISRjdnGCtpcxcUSFg3tww=";
      };
    };
}

If fails with:

error: fetchurl requires either urlorurls to be set (while evaluating the attribute 'urls' of the derivation 'AI-Improvements-1.16.5-0.5.0.jar')

~~Also, not setting the hashes manually causes a confusing error; it doesn't report the hash that should be used. (Btw, since you're using flakes, maybe that's a job for the flake.lock?)~~

Edit: the bit about the hashes is apparently a hard "no"; see https://github.com/NixOS/nix/issues/4945 (Though the error message when not setting the hash is still confusing.)

werner291 avatar Oct 15 '23 02:10 werner291