Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fetchPackwizModpack support parameter src as drv instead of url #110

Open
luochen1990 opened this issue Nov 4, 2024 · 1 comment
Open

Comments

@luochen1990
Copy link

I hope these code

  modpack = pkgs.fetchPackwizModpack {
    url = "https://github.com/Misterio77/Modpack/raw/0.2.9/pack.toml";
    packHash = "sha256-L5RiSktqtSQBDecVfGj1iDaXV+E90zrNEcf4jtsg+wk=";
  };

Can be replaced into:

  modpack = pkgs.fetchPackwizModpack {
    src = fetchFromGithub { owner = "Misterio77"; repo = "Modpack"; rev = "master"; sha256 = "";};
  };

And if the name of pack.toml is not special enough, we can specify it like

  modpack = pkgs.fetchPackwizModpack {
    src = fetchFromGithub { owner = "Misterio77"; repo = "Modpack"; rev = "master"; sha256 = "";};
    path = "pack.toml";
  };
@haussjonas
Copy link

I'm not a nix expert, but I would suggest a more flexible option that supports more fetchers. For example, for my purposes, I use the following solution to load local packages:

let
  serverPack = builtins.path {
    path = ./modpacks/server;
  };
  serverModpack = (pkgs.fetchPackwizModpack {
    url = "file://${serverPack}/pack.toml";
    packHash = "sha256-zdhJ1cv8nCzqoAD9vsXk6vAzPUMFI8G6k3ComHrQaE0=";
  });
in
{}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants