Files
minecraft-heatmap/flake.nix

42 lines
1.1 KiB
Nix

{
inputs.nixpkgs.url = "nixpkgs/nixpkgs-unstable";
outputs = { self, nixpkgs }: let
inherit (nixpkgs) lib;
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
"armv7l-linux"
];
forAllSystems = f: lib.genAttrs systems (system: f system nixpkgs.legacyPackages.${system});
in {
devShells = forAllSystems (system: pkgs: {
default = pkgs.mkShell {
packages = with pkgs; [
ruff
(python3.withPackages (ppkgs: with ppkgs; [
psycopg2-binary
]))
];
};
});
packages = forAllSystems (system: pkgs: {
default = self.packages.${system}.mclog2psql;
mclog2psql = pkgs.writers.writePython3Bin "mclog2psql" {
libraries = [ pkgs.python3Packages.psycopg2 ];
flakeIgnore = [ "E265" "E501" ];
} (lib.pipe ./mclog2psql/main.py [
builtins.readFile
(lib.splitString "\n")
(lib.filter (line: !lib.hasPrefix "#!" line))
(lib.concatStringsSep "\n")
]);
});
};
}