master
Simon Bruder 2021-08-07 10:55:03 +02:00
commit 350b8ba0ef
Signed by: simon
GPG Key ID: 8D3C82F9F309F8EC
7 changed files with 178 additions and 0 deletions

1
.envrc Normal file
View File

@ -0,0 +1 @@
use flake

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.pre-commit-config.yaml
result*

20
LICENSE Normal file
View File

@ -0,0 +1,20 @@
The MIT License
Copyright 2021 Simon Bruder
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

36
README.md Normal file
View File

@ -0,0 +1,36 @@
# pokegb-nix
A nixpkgs overlay for compiling/assembling Game Boy Pokémon ROMs.
## Usage
If you have a Nix version with flake support, simply run a command like this:
```bash
nix build ".#pokegb/red" # builds Pokémon Red/Blue
nix build ".#pokegb/all" # builds all ROMs into one directory
```
For the legacy Nix UI you can use a command like this:
```bash
nix-build -E 'import <nixpkgs> { overlays = [ (import ./default.nix) ]; }' -A pokegb.red
```
If you do not allow unfree packages globally, you might have to run the command
with the environment variable `NIXPKGS_ALLOW_UNFREE=1` set.
You can find a list of all packages provided by this overlay in `default.nix`.
## License
[The MIT License](./LICENSE)
This only applies to the package expressions, not the built packages. Patches
may also be licensed differently, since they may be derivative works of the
packages to which they apply.
##### Disclaimer
This project is not affiliated with Nintendo or any of its subsidiaries.
Pokémon is a registered trademark of Nintendo.

1
default.nix Normal file
View File

@ -0,0 +1 @@
final: prev: { }

68
flake.lock Normal file
View File

@ -0,0 +1,68 @@
{
"nodes": {
"flake-utils": {
"locked": {
"lastModified": 1623875721,
"narHash": "sha256-A8BU7bjS5GirpAUv4QA+QnJ4CceLHkcXdRp4xITDB0s=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "f7e004a55b120c02ecb6219596820fcd32ca8772",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nix-pre-commit-hooks": {
"inputs": {
"flake-utils": [
"flake-utils"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1624971177,
"narHash": "sha256-Amf/nBj1E77RmbSSmV+hg6YOpR+rddCbbVgo5C7BS0I=",
"owner": "cachix",
"repo": "pre-commit-hooks.nix",
"rev": "397f0713d007250a2c7a745e555fa16c5dc8cadb",
"type": "github"
},
"original": {
"owner": "cachix",
"ref": "master",
"repo": "pre-commit-hooks.nix",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1628280432,
"narHash": "sha256-bqwbY8NtJ2S7RXJpYK0Xw0vMZRzmxS5KmSWIb0g7/Ts=",
"owner": "sbruder",
"repo": "nixpkgs",
"rev": "bf6d934cf80e6f5365d3193e01840397709d4d87",
"type": "github"
},
"original": {
"owner": "sbruder",
"ref": "update-rgbds",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"flake-utils": "flake-utils",
"nix-pre-commit-hooks": "nix-pre-commit-hooks",
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

50
flake.nix Normal file
View File

@ -0,0 +1,50 @@
{
description = "A nixpkgs overlay for compiling/assembling Game Boy Pokémon ROMs";
inputs = {
# Until https://github.com/NixOS/nixpkgs/pull/132928 gets merged, this fork
# has to be used because the ROMs require rgbds 0.5.1.
nixpkgs.url = "github:sbruder/nixpkgs/update-rgbds";
flake-utils.url = "github:numtide/flake-utils";
nix-pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix/master";
nix-pre-commit-hooks.inputs.flake-utils.follows = "flake-utils";
nix-pre-commit-hooks.inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, flake-utils, nix-pre-commit-hooks }:
let
inherit (nixpkgs) lib;
in
{
overlay = import ./default.nix;
} // (flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlay ];
config = {
allowUnfree = true;
};
};
in
rec {
checks = {
pre-commit-check = nix-pre-commit-hooks.lib.${system}.run {
src = self;
hooks = {
nixpkgs-fmt.enable = true;
};
};
};
devShell = pkgs.mkShell {
inherit (self.checks.${system}.pre-commit-check) shellHook;
};
packages = flake-utils.lib.flattenTree {
inherit (pkgs);
};
}));
}