mirror of
https://github.com/kittywitch/katgba.git
synced 2025-12-22 00:09:17 -08:00
feat: shell with emulator
This commit is contained in:
parent
f21118f9f7
commit
cdaa9c1514
5 changed files with 37 additions and 22 deletions
1
.envrc
Normal file
1
.envrc
Normal file
|
|
@ -0,0 +1 @@
|
|||
use flake
|
||||
12
README.md
12
README.md
|
|
@ -19,3 +19,15 @@ nix build .#katgba
|
|||
# Use mgba-qt with a built rom
|
||||
nix run .#katgba-emu
|
||||
```
|
||||
|
||||
## Shell
|
||||
|
||||
```
|
||||
# Allow permissions for direnv to use shell
|
||||
direnv allow
|
||||
# or consume with `nix develop`
|
||||
nix develop
|
||||
|
||||
# Use mgba-qt with a built rom
|
||||
katgba-emu
|
||||
```
|
||||
|
|
|
|||
29
flake.nix
29
flake.nix
|
|
@ -57,21 +57,26 @@
|
|||
targets = [ ];
|
||||
}
|
||||
);
|
||||
rustToolchain = rustToolchainFor pkgs;
|
||||
rustToolchain = rustToolchainFor pkgs;
|
||||
|
||||
craneLib = (crane.mkLib pkgs).overrideToolchain rustToolchainFor;
|
||||
|
||||
myPackage = pkgs.callPackage ./package.nix { inherit craneLib rustToolchain rustTriple; };
|
||||
craneLib = (crane.mkLib pkgs).overrideToolchain rustToolchainFor;
|
||||
katgba-emu = pkgs.callPackage ./katgba-emu.nix { inherit katgba; };
|
||||
katgba = pkgs.callPackage ./package.nix { inherit craneLib rustToolchain rustTriple; };
|
||||
in {
|
||||
packages = {
|
||||
default = myPackage;
|
||||
katgba = myPackage;
|
||||
};
|
||||
apps = rec {
|
||||
katgba-emu = flake-utils.lib.mkApp { drv = pkgs.writeShellScriptBin "katgba-emu" ''
|
||||
${pkgs.mgba}/bin/mgba-qt ${lib.getExe' self.packages.${system}.default "katgba"}
|
||||
''; };
|
||||
devShells = let
|
||||
katgba-emu = pkgs.mkShell {
|
||||
nativeBuildInputs = [
|
||||
self.packages.${pkgs.system}.katgba-emu
|
||||
];
|
||||
};
|
||||
in {
|
||||
default = katgba-emu;
|
||||
inherit katgba-emu;
|
||||
};
|
||||
packages = {
|
||||
default = katgba;
|
||||
katgba-emu = katgba-emu;
|
||||
inherit katgba;
|
||||
};
|
||||
});
|
||||
}
|
||||
|
|
|
|||
7
katgba-emu.nix
Normal file
7
katgba-emu.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{ writeShellScriptBin, mgba, lib, katgba }:
|
||||
|
||||
let
|
||||
inherit (lib.meta) getExe';
|
||||
in writeShellScriptBin "katgba-emu" ''
|
||||
${mgba}/bin/mgba-qt ${getExe' katgba "katgba"}
|
||||
''
|
||||
10
shell.nix
10
shell.nix
|
|
@ -1,10 +0,0 @@
|
|||
{
|
||||
mkShell,
|
||||
mgba,
|
||||
rust-bin
|
||||
}: mkShell {
|
||||
packages = [
|
||||
rust-bin.selectLatestNightlyWith (toolchain: toolchain.default)
|
||||
];
|
||||
};
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue