generated from GarandPLG/rust-flake-template
Introduce support structures (roof supports) and a stress system that propagates from bases through tunnels, causing collapses when stress reaches 100 %. Add auto‑support feature with toggleable tasks, new keybindings (Tasks, AutoSupports, Stress), and a support‑building tab. Implement collapsed tunnels, support work progress, and related UI rendering (stress view, auto‑support indicators). Extend board resize logic, update game state structs, and adjust keybinding actions. Update documentation (README, AGENTS, CODE_MAP, PROGRESS, TESTING) to reflect new features. Add flake.nix dependencies (bash, gitea‑actions‑runner, docker). Add extensive tests for tunnel stress, support building, auto‑supports, and related mechanics.
86 lines
2.4 KiB
Nix
86 lines
2.4 KiB
Nix
{
|
|
description = "TUI underground RTS";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
|
|
|
|
fenix = {
|
|
url = "github:nix-community/fenix";
|
|
inputs.nixpkgs.follows = "nixpkgs";
|
|
};
|
|
|
|
naersk = {
|
|
url = "github:nix-community/naersk";
|
|
inputs = {
|
|
nixpkgs.follows = "nixpkgs";
|
|
fenix.follows = "fenix";
|
|
};
|
|
};
|
|
};
|
|
|
|
outputs = {
|
|
self,
|
|
nixpkgs,
|
|
naersk,
|
|
fenix,
|
|
}: let
|
|
system = "x86_64-linux";
|
|
pkgs = nixpkgs.legacyPackages.${system};
|
|
|
|
rustToolchain = fenix.packages.${system}.stable.toolchain;
|
|
naerskLib = pkgs.callPackage naersk {
|
|
cargo = rustToolchain;
|
|
rustc = rustToolchain;
|
|
};
|
|
|
|
cargoToml = fromTOML (builtins.readFile ./Cargo.toml);
|
|
packageVersion = cargoToml.package.version;
|
|
in {
|
|
packages.${system} = {
|
|
default = pkgs.callPackage ./default.nix {};
|
|
|
|
develop = naerskLib.buildPackage {
|
|
name = "war-in-tunnels";
|
|
src = ./.;
|
|
buildInputs = with pkgs; [alsa-lib];
|
|
nativeBuildInputs = with pkgs; [pkg-config];
|
|
postInstall = ''
|
|
cp -r soundtracks $out/bin
|
|
mv $out/bin/war_in_tunnels $out/bin/war-in-tunnels
|
|
'';
|
|
};
|
|
};
|
|
|
|
devShells.${system}.default = pkgs.mkShell {
|
|
env = {
|
|
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
|
|
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath (with pkgs; [alsa-lib]);
|
|
};
|
|
buildInputs = with pkgs; [
|
|
rustToolchain
|
|
alsa-lib
|
|
bash
|
|
gitea-actions-runner
|
|
docker
|
|
];
|
|
nativeBuildInputs = with pkgs; [pkg-config];
|
|
|
|
shellHook = ''
|
|
echo "War in Tunnels v${packageVersion}"
|
|
echo ""
|
|
echo "Commands:"
|
|
echo " nix build - Build production version"
|
|
echo " nix run - Run production version"
|
|
echo " nix build .#develop - Build development version"
|
|
echo " nix run .#develop - Run development version"
|
|
echo ""
|
|
echo "Gitea workflows:"
|
|
echo " gitea-runner exec -W .gitea/workflows/rust.yml --event push -j check"
|
|
echo " gitea-runner exec -W .gitea/workflows/nix.yml --event push -j build"
|
|
echo " gitea-runner exec -W .gitea/workflows/packages.yml --event push -j linux"
|
|
echo " gitea-runner exec -W .gitea/workflows/packages.yml --event push -j aur"
|
|
'';
|
|
};
|
|
};
|
|
}
|