balatro-flake/flake.nix

37 lines
1.0 KiB
Nix

{
description = "Packages concerning the game Balatro.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = {
self,
nixpkgs,
...
}: let
supportedSystems = ["x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin"];
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
pkgs = forAllSystems (system: nixpkgs.legacyPackages.${system});
in {
# `nix build`
packages = forAllSystems (system: rec {
balatro = pkgs.${system}.callPackage ./balatro/package.nix {};
balatromobile = pkgs.${system}.callPackage ./balatromobile/package.nix {};
balatro-android = pkgs.${system}.callPackage ./balatro-android/package.nix {inherit balatro balatromobile;};
});
# `nix run`
apps = forAllSystems (system: {
balatro = {
program = "${self.packages.${system}.balatro}/bin/balatro";
type = "app";
};
balatromobile = {
program = "${self.packages.${system}.balatromobile}/bin/balatromobile";
type = "app";
};
});
};
}