Something went wrong. Try again.
Collection of macros
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798{ description = "Cross-platform game macros (input + OCR abstraction + per-macro apps)";
inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; };
outputs = { self, nixpkgs }: let systems = [ "aarch64-darwin" "x86_64-darwin" "aarch64-linux" "x86_64-linux" ]; forAllSystems = f: nixpkgs.lib.genAttrs systems f;
# Adds the custom pyobjc frameworks and the macros package to the Python # package set (via pythonPackagesExtensions, so they participate in the # normal dependency graph instead of being patched in ad hoc). pythonOverlay = final: prev: { pythonPackagesExtensions = prev.pythonPackagesExtensions ++ [ (pyfinal: pyprev: { pyobjc-framework-CoreML = pyfinal.callPackage ./nix/pyobjc-framework.nix { framework = "CoreML"; deps = [ pyfinal.pyobjc-framework-Cocoa ]; }; pyobjc-framework-Vision = pyfinal.callPackage ./nix/pyobjc-framework.nix { framework = "Vision"; deps = [ pyfinal.pyobjc-framework-Cocoa pyfinal.pyobjc-framework-Quartz pyfinal.pyobjc-framework-CoreML ]; }; game-macros = pyfinal.callPackage ./nix/game-macros.nix { }; }) ]; };
pkgsFor = system: import nixpkgs { inherit system; overlays = [ pythonOverlay ]; }; in { packages = forAllSystems ( system: let pkgs = pkgsFor system; game-macros = pkgs.python3Packages.game-macros; in { inherit game-macros; default = game-macros; } );
apps = forAllSystems ( system: let pkgs = pkgsFor system; game-macros = pkgs.python3Packages.game-macros; shoguns-reign = { type = "app"; program = pkgs.lib.getExe' game-macros "shoguns-reign"; }; in { inherit shoguns-reign; default = shoguns-reign; } );
devShells = forAllSystems ( system: let pkgs = pkgsFor system; python = pkgs.python3.withPackages (ps: [ ps.game-macros ps.setuptools ]); in { default = pkgs.mkShell { packages = [ python ] ++ pkgs.lib.optionals pkgs.stdenv.hostPlatform.isLinux [ pkgs.grim ]; shellHook = '' export PYTHONPATH="$PWD/src''${PYTHONPATH:+:$PYTHONPATH}" ''; }; } ); };}