Skip to content

Conversation

@tumble1999
Copy link
Contributor

@tumble1999 tumble1999 commented Jul 12, 2025

New Nix functions for mod compilation

setup channel:

nix-channel --add https://github.com/MCPI-Revival/ninecraft/archive/master.tar.gz ninecraft
nix-channel --update
with import <ninecraft/nix> {}:
buildNinecraftMod {
  pname = "mymod";
  version = "0.1.0";
  src = ./src;
}
with import <ninecraft/nix> {}:
buildNinecraftMod {
  pname = "mymod";
  version = "0.1.0";
  src = fetchurl {
    url = "example.com/path/to/mod.zip";
    hash = lib.fakeHash;
  };
  precompiled = true;
  compiledX86 = "x86/mod.so";
compiledArm = "arm/mod.so";
}
with import <nixpkgs> {};
with import <ninecraft/nix> {}:
buildNinecraftMod {
  pname = "mymod";
  version = "0.1.0";
  src = fetchurl {
    url = "example.com/path/to/mod/${system}/mod.so";
    hash = lib.fakeHash;
  };
  precompiled = true;
}
with import <nixpkgs> {};
with import <ninecraft/nix> {}:
let
  someNixFileSomeoneMadeThatHasAMod = import <bob> {};
in
buildNinecraftInstance {
  version = versions.PE-a0_8_0_x86;
  options.mp_username = "bobface";
  mods = [
    (fetchurl { url = ""; hash = "sha256";})

    (fetchurl { url = ""; hash = "sha256";})

    (buildNinecraftMod {
      name = "modName";
      src = fetchurl { url = ""; hash = "sha256";};
      precompiled = true;
      compiledx86 = "x86/mod.so";
    })

   someNixFileSomeoneMadeThatHasAMod.modname

  ];
}

@tumble1999 tumble1999 marked this pull request as ready for review July 16, 2025 11:24
@tumble1999 tumble1999 marked this pull request as draft July 24, 2025 11:44
@tumble1999 tumble1999 marked this pull request as ready for review July 25, 2025 16:26
@MFDGaming MFDGaming merged commit f622499 into MCPI-Revival:master Jul 25, 2025
1 check failed
@tumble1999 tumble1999 deleted the mod-framework branch July 25, 2025 19:43
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

Successfully merging this pull request may close these issues.

2 participants