1
0
Fork 0
3ds-helloWorld/flake.nix
2024-03-21 10:05:02 +01:00

47 lines
1.3 KiB
Nix

{
description = "Nix flake for building and developing 3DS projects";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-23.11";
devkitnix.url = "github:toast003/devkitnix";
};
outputs = { self, nixpkgs, devkitnix }:
let
system = "x86_64-linux";
devkitARM = devkitnix.outputs.packages.${system}.devkitARM;
in
{
devShells.${system}.default = nixpkgs.legacyPackages.${system}.mkShell {
name = "3ds-devshell";
packages = with nixpkgs.legacyPackages.${system}; [
gnumake
ccls
(
writeShellScriptBin "generateClangCompileCommands" ''
make clean
${bear}/bin/bear -- make
''
)
];
shellHook = ''
export DEVKITPRO=${devkitARM}
export DEVKITARM=${devkitARM}/devkitARM
'';
};
packages.${system}.default = nixpkgs.legacyPackages.${system}.stdenv.mkDerivation {
name = "3ds-template";
src = self;
preBuild = ''
export DEVKITPRO=${devkitARM}
export DEVKITARM=${devkitARM}/devkitARM
'';
installPhase = ''
mkdir $out
mv *.3dsx *.elf *.smdh --target-directory $out/
'';
# Building 3ds apps here, we don't need to do this
dontFixup = true;
};
};
}