This repository has been archived on 2024-01-28. You can view files and clone it, but cannot push or open issues/pull-requests.
pokegb-nix/flake.nix

55 lines
1.5 KiB
Nix

{
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)
agbcc
pokegb;
};
defaultPackage = packages."pokegb/all";
}));
}