initial commit

This commit is contained in:
Kristian Krsnik 2025-04-23 20:53:49 +02:00
commit 58ae7c9dd1
Signed by: Kristian
GPG Key ID: FD1330AC9F909E85
5 changed files with 88 additions and 0 deletions

5
.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
# Nix #
/result
# balatromobile #
/balatro*.apk

3
README.md Normal file
View File

@ -0,0 +1,3 @@
# Balatromobile Flake
This repository packages [balatromobile](https://github.com/antipatico/balatromobile) for use with NixOS.

21
default.nix Normal file
View File

@ -0,0 +1,21 @@
{
fetchgit,
python3Packages,
jre,
...
}: let
src = fetchgit {
url = "https://github.com/antipatico/balatromobile";
sha256 = "P6MVmDiI6NLHqBYdkbtqExHKjkjLeD5bE/kTEyPxVTw=";
fetchLFS = true;
};
pname = (builtins.fromTOML (builtins.readFile "${src}/pyproject.toml")).project.name;
version = builtins.elemAt (builtins.match ".*([0-9]+\.[0-9]+\.[0-9]+).*" (builtins.readFile "${src}/balatromobile/__version__.py")) 0;
in
python3Packages.buildPythonPackage {
inherit pname version src;
pyproject = true;
build-system = [python3Packages.flit];
dependencies = [python3Packages.tabulate jre];
}

27
flake.lock generated Normal file
View File

@ -0,0 +1,27 @@
{
"nodes": {
"nixpkgs": {
"locked": {
"lastModified": 1745234285,
"narHash": "sha256-GfpyMzxwkfgRVN0cTGQSkTC0OHhEkv3Jf6Tcjm//qZ0=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "c11863f1e964833214b767f4a369c6e6a7aba141",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"nixpkgs": "nixpkgs"
}
}
},
"root": "root",
"version": 7
}

32
flake.nix Normal file
View File

@ -0,0 +1,32 @@
{
description = "A Python Project Template.";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
};
outputs = {
self,
nixpkgs,
...
} @ inputs: 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 {
default = balatromobile;
balatromobile = pkgs.${system}.callPackage ./default.nix {};
});
# `nix run`
apps = forAllSystems (system: rec {
default = balatromobile;
balatromobile = {
program = "${self.packages.${system}.balatromobile}/bin/balatromobile";
type = "app";
};
});
};
}