-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
358 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[unstable] | ||
build-std = ["std", "panic_abort", "core", "alloc"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
use flake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/target | ||
Cargo.lock | ||
/.direnv | ||
/result |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
{ | ||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11"; | ||
|
||
flake-utils.url = "github:numtide/flake-utils"; | ||
|
||
rust-overlay.url = "github:oxalica/rust-overlay"; | ||
|
||
cargo-skyline-src = { | ||
url = "github:jam1garner/cargo-skyline"; | ||
flake = false; | ||
}; | ||
|
||
skyline-rs = { | ||
url = "github:ultimate-research/skyline-rs"; | ||
flake = false; | ||
}; | ||
}; | ||
|
||
outputs = | ||
{ self | ||
, nixpkgs | ||
, flake-utils | ||
, rust-overlay | ||
, cargo-skyline-src | ||
, skyline-rs | ||
}: (flake-utils.lib.eachDefaultSystem (system: | ||
let | ||
pkgs = import nixpkgs { | ||
inherit system; | ||
overlays = [ | ||
rust-overlay.overlays.default | ||
]; | ||
}; | ||
|
||
rustToolchain = (pkgs.rust-bin.nightly."2023-12-30".default.override { | ||
extensions = [ | ||
"rust-src" | ||
"rust-std" | ||
]; | ||
}); | ||
rustPlatform = pkgs.makeRustPlatform { | ||
cargo = rustToolchain; | ||
rustc = rustToolchain; | ||
}; | ||
|
||
cargo-skyline = rustPlatform.buildRustPackage { | ||
pname = "cargo-skyline"; | ||
version = (builtins.fromTOML (builtins.readFile "${cargo-skyline-src}/Cargo.toml")).package.version; | ||
|
||
src = cargo-skyline-src; | ||
|
||
cargoLock = { | ||
lockFile = "${cargo-skyline-src}/Cargo.lock"; | ||
}; | ||
|
||
meta = { | ||
description = "A cargo subcommand for working with Skyline plugins written in Rust"; | ||
}; | ||
}; | ||
in | ||
{ | ||
packages.rustToolchain = rustToolchain; | ||
|
||
devShells.default = pkgs.mkShell { | ||
nativeBuildInputs = builtins.attrValues { | ||
inherit cargo-skyline; | ||
|
||
# for now, we use rustup to manage the toolchain | ||
# because skyline has some weird customizations that | ||
# I don't feel like getting into at this point in time | ||
# this means no reproducible builds (for now), but I can live with that | ||
inherit (pkgs) rustup; | ||
}; | ||
|
||
# this is mainly for rust-analyzer to not get confused | ||
CARGO_BUILD_TARGET = "${skyline-rs}/aarch64-skyline-switch.json"; | ||
}; | ||
})); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#![feature(restricted_std)] | ||
|
||
use skyline::hooks::InlineCtx; | ||
|
||
#[skyline::from_offset(0x37a1270)] | ||
|