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

Nixify #657

Draft
wants to merge 1 commit into
base: trunk
Choose a base branch
from
Draft

Nixify #657

wants to merge 1 commit into from

Conversation

knedlsepp
Copy link

This adds a development environment using the nix package manager.
It's somewhat of an alternative to the current Dockerfile, but has more
powerful caching and reproducibility guarantees.
Also I included an integration test that:

  • Builds libdragon
  • Builds the examples
  • Starts a virtual machine
  • Runs the audioplayer.z64 example ROM in ares
  • Uses OCR to wait for the "Module Audio Player" to appear on screen
  • Takes a screenshot for later inspection.

It can be run using nix build .#checks.x86_64-linux.vmTest.
There's lots more neat things that can be done with nix.
I'm putting this out as a draft mostly for visibility.

Notes:

- Haven't yet tried if the nixpkgs mips64-embedded toolchain would work
  as well. That would be great.

TODO:

- https://github.com/bates64/hotload?tab=readme-ov-file
@bates64
Copy link

bates64 commented Jan 12, 2025

I've had success using a custom crossSystem and then using pkgs.mkShell to get the toolchain. Example

let
    crossSystem = {
        config = "mips64-elf";
        system = "mips64-elf";
        gcc.arch = "vr4300";
        gcc.tune = "vr4300";
        gcc.abi = "32";
    };
    pkgsCross = import nixpkgs { inherit system, crossSystem; };
in
    devShells.default = pkgsCross.mkShell {
        # ...
    }

Using NixOS's mips64-embedded might work, but it's not tuned to the vr4300, and I don't believe it's built on Hydra anyway. I've been using a Cachix cache so users don't have to build from source: https://papermario-dx.cachix.org

@knedlsepp
Copy link
Author

knedlsepp commented Jan 12, 2025

I've had success using a custom crossSystem

Neat! Thanks for sharing! 😊

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