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

Nix flake #42

Merged
merged 1 commit into from
Jan 4, 2024
Merged

Nix flake #42

merged 1 commit into from
Jan 4, 2024

Conversation

oatmealine
Copy link
Contributor

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
Copy link
Contributor

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

  • mcapi: only sources::vanilla and sources::hangar depends on it afaik, should be simple
  • pathdiff: its a single function lol (probably ask author of the code?)
  • rpackwiz: we just use the structs, should be easy to move them

@TheAlan404 TheAlan404 merged commit c6c7168 into ParadigmMC:main Jan 4, 2024
@oatmealine oatmealine deleted the nix-flake branch January 4, 2024 10:57
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