ParadigmMC / mcman

Powerful Minecraft Server Manager CLI. Easily install jars (server, plugins & mods) and write config files. Docker and git support included.
GNU General Public License v3.0
162 stars 14 forks source link

Nix flake #42

Closed oatmealine closed 9 months ago

oatmealine commented 9 months ago

Implements a basic Nix flake with a package:

oatmealine@goop-drive ~/p/mcman (main) [1]> nix run
Powerful Minecraft Server Manager CLI

Usage: mcman <COMMAND>

Commands:
  init      Initialize a new mcman server
  build     Build using server.toml configuration
  run       Test the server (stops it when it ends startup)
  dev       Start a development session
  add       Add a plugin/mod/datapack
  pull      Pull files from server/ to config/
  env       Helpers for setting up the environment
  world     Pack or unpack a world [aliases: w]
  import    Importing tools [aliases: i]
  export    Exporting tools
  markdown  Update markdown files with server info [aliases: md]
  download  Download a downloadable [aliases: dl]
  cache     Cache management commands
  info      Show info about the server in console
  version   Show version information [aliases: v]
  help      Print this message or the help of the given subcommand(s)

Options:
  -h, --help  Print help

To start building servers, try 'mcman init'

This lets NixOS users natively pull in the package from this repository.

Currently this does not include a service, dev shell or anything else; meaning you cannot host servers simply using this flake. However, if this is desired, I could begin work on that!

Note: I'm unsure if this is something you can fix on your end as I'm not too familiar with Cargo/Rust packages, but mcapi, pathdiff and rpackwiz lack checksum hashes in Cargo.lock, which means they have to currently be manually specified in the Nix flake:

        cargoLock.outputHashes = {
          "mcapi-0.2.0" = "sha256-wHXA+4DQVQpfSCfJLFuc9kUSwyqo6T4o0PypYdhpp5s=";
          "pathdiff-0.2.1" = "sha256-+X1afTOLIVk1AOopQwnjdobKw6P8BXEXkdZOieHW5Os=";
          "rpackwiz-0.1.0" = "sha256-pOotNPIZS/BXiJWZVECXzP1lkb/o9J1tu6G2OqyEnI8=";
        };

These will have to be updated to prevent accidental caching issues. However, if the Cargo.lock contains them instead, these could be safely removed.

TheAlan404 commented 9 months ago

I plan to move those three crates into this repository since it will also allow mcman to be published to crates.io