mirror of
https://github.com/kittywitch/katgba.git
synced 2025-12-22 00:09:17 -08:00
feat: make build :o
This commit is contained in:
commit
3c055d49e9
13 changed files with 521 additions and 0 deletions
64
flake.nix
Normal file
64
flake.nix
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
{
|
||||
description = "gba";
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
crane.url = "github:ipetkov/crane";
|
||||
flake-utils.url = "github:numtide/flake-utils";
|
||||
rust-overlay = {
|
||||
url = "github:oxalica/rust-overlay";
|
||||
inputs.nixpkgs.follows = "nixpkgs";
|
||||
};
|
||||
};
|
||||
|
||||
outputs =
|
||||
{
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
rust-overlay,
|
||||
crane,
|
||||
...
|
||||
}:
|
||||
let
|
||||
inherit (nixpkgs) lib;
|
||||
rustTriple = "thumbv4t-none-eabi";
|
||||
nixTriple = "arm-none-eabi";
|
||||
in flake-utils.lib.eachDefaultSystem (system: let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
overlays = [ (import rust-overlay) ];
|
||||
};
|
||||
pkgsCross = import nixpkgs {
|
||||
inherit system;
|
||||
config = {
|
||||
allowUnsupportedSystem = true;
|
||||
#replaceStdenv = ({ pkgs }: pkgs.clangStdenvNoLibs );
|
||||
};
|
||||
crossSystem = {
|
||||
config = nixTriple;
|
||||
libc = "newlib";
|
||||
#rust.rustcTarget = rustTriple;
|
||||
gcc = {
|
||||
arch = "armv4t";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
rustToolchainFor =
|
||||
p:
|
||||
p.rust-bin.selectLatestNightlyWith (
|
||||
toolchain:
|
||||
toolchain.minimal.override {
|
||||
extensions = [ "rust-src" ];
|
||||
targets = [ ];
|
||||
}
|
||||
);
|
||||
rustToolchain = rustToolchainFor pkgs;
|
||||
|
||||
craneLib = (crane.mkLib pkgs).overrideToolchain rustToolchainFor;
|
||||
|
||||
myPackage = pkgs.callPackage ./package.nix { inherit craneLib rustToolchain rustTriple; };
|
||||
in {
|
||||
inherit pkgsCross;
|
||||
packages.default = myPackage;
|
||||
});
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue