mineschemer/flake.nix

52 lines
1.8 KiB
Nix
Raw Normal View History

2023-12-20 21:41:06 -05:00
# This flake was initially generated by fh, the CLI for FlakeHub (version 0.1.9)
{
inputs = {
flake-schemas.url = "https://flakehub.com/f/DeterminateSystems/flake-schemas/*.tar.gz";
nixpkgs.url = "https://flakehub.com/f/NixOS/nixpkgs/*.tar.gz";
};
outputs = { self, flake-schemas, nixpkgs }:
let
supportedSystems = [ "x86_64-linux" ];
forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: f {
pkgs = import nixpkgs { inherit system; };
});
in {
schemas = flake-schemas.schemas;
2023-12-24 13:27:27 -05:00
packages = forEachSupportedSystem ({ pkgs }: {
default = pkgs.writeShellScriptBin "mineschemer" ''
2023-12-24 13:33:14 -05:00
LD_LIBRARY_PATH="${pkgs.raylib}/lib" \
${pkgs.chez}/bin/scheme \
--script ${./main.scm} \
${./skins/classic.bmp} \
$@
2023-12-24 13:27:27 -05:00
'';
2023-12-24 13:52:05 -05:00
# get it? GET IT?
gum-wrapper = pkgs.writeShellScriptBin "mineschemer-gum-wrapper" ''
LD_LIBRARY_PATH="${pkgs.raylib}/lib" \
${pkgs.chez}/bin/scheme \
--script ${./main.scm} \
${./skins/classic.bmp} \
$(${pkgs.gum}/bin/gum input --prompt="mines: " --placeholder="must be a natural number") \
$(${pkgs.gum}/bin/gum input --prompt="width: " --placeholder="must be a natural number") \
$(${pkgs.gum}/bin/gum input --prompt="height: " --placeholder="must be a natural number")
'';
2023-12-24 13:27:27 -05:00
});
2023-12-20 21:41:06 -05:00
devShells = forEachSupportedSystem ({ pkgs }: {
default = pkgs.mkShell {
packages = with pkgs; [
nixpkgs-fmt
chez
raylib
];
LD_LIBRARY_PATH="${pkgs.raylib}/lib";
2023-12-21 14:30:43 -05:00
# not necessary
LIBRARY_PATH="${pkgs.raylib}/include";
2023-12-20 21:41:06 -05:00
};
});
};
}