This commit is contained in:
2025-11-13 00:04:03 +01:00
commit 830075116a
9 changed files with 5774 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
/target
/result

5544
Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

13
Cargo.toml Normal file
View File

@@ -0,0 +1,13 @@
[package]
name = "war-in-tunnels"
version = "0.1.0"
edition = "2024"
[dependencies]
bevy = "0.17.2"
[profile.dev]
opt-level = 1
[profile.dev.package."*"]
opt-level = 3

18
LICENSE Normal file
View File

@@ -0,0 +1,18 @@
MIT License
Copyright (c) 2025 GarandPLG
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.

0
README.md Normal file
View File

21
default.nix Normal file
View File

@@ -0,0 +1,21 @@
{
# lib,
rustPlatform,
packageName,
pkg-config,
wayland,
alsa-lib,
libudev-zero,
}:
rustPlatform.buildRustPackage {
name = "${packageName}";
src = ./.;
buildInputs = [
wayland
alsa-lib
libudev-zero
];
nativeBuildInputs = [ pkg-config ];
# cargoHash = lib.fakeHash;
cargoHash = "sha256-ZJ7DODvIiupVlmBUhQhXEVlNeDT0S62z/5Qln77JpQc=";
}

90
flake.lock generated Normal file
View File

@@ -0,0 +1,90 @@
{
"nodes": {
"fenix": {
"inputs": {
"nixpkgs": [
"nixpkgs"
],
"rust-analyzer-src": "rust-analyzer-src"
},
"locked": {
"lastModified": 1762929886,
"narHash": "sha256-TQZ3Ugb1FoHpTSc8KLrzN4njIZU4FemAMHyS4M3mt6s=",
"owner": "nix-community",
"repo": "fenix",
"rev": "6998514dce2c365142a0a119a95ef95d89b84086",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "fenix",
"type": "github"
}
},
"naersk": {
"inputs": {
"fenix": [
"fenix"
],
"nixpkgs": [
"nixpkgs"
]
},
"locked": {
"lastModified": 1752689277,
"narHash": "sha256-uldUBFkZe/E7qbvxa3mH1ItrWZyT6w1dBKJQF/3ZSsc=",
"owner": "nix-community",
"repo": "naersk",
"rev": "0e72363d0938b0208d6c646d10649164c43f4d64",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "naersk",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1762844143,
"narHash": "sha256-SlybxLZ1/e4T2lb1czEtWVzDCVSTvk9WLwGhmxFmBxI=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "9da7f1cf7f8a6e2a7cb3001b048546c92a8258b4",
"type": "github"
},
"original": {
"owner": "nixos",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"fenix": "fenix",
"naersk": "naersk",
"nixpkgs": "nixpkgs"
}
},
"rust-analyzer-src": {
"flake": false,
"locked": {
"lastModified": 1762860488,
"narHash": "sha256-rMfWMCOo/pPefM2We0iMBLi2kLBAnYoB9thi4qS7uk4=",
"owner": "rust-lang",
"repo": "rust-analyzer",
"rev": "2efc80078029894eec0699f62ec8d5c1a56af763",
"type": "github"
},
"original": {
"owner": "rust-lang",
"ref": "nightly",
"repo": "rust-analyzer",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

83
flake.nix Normal file
View File

@@ -0,0 +1,83 @@
{
description = "War in Tunnels flake for development and production";
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 = builtins.fromTOML (builtins.readFile ./Cargo.toml);
packageName = cargoToml.package.name;
packageVersion = cargoToml.package.version;
bevyVersion = cargoToml.dependencies.bevy;
in
{
packages.${system} = {
default = pkgs.callPackage ./default.nix {
packageName = packageName;
};
develop = naerskLib.buildPackage {
name = "${packageName}";
src = ./.;
buildInputs = with pkgs; [
wayland
alsa-lib
libudev-zero
];
nativeBuildInputs = with pkgs; [ pkg-config ];
};
};
devShells.${system}.default = pkgs.mkShell {
env.RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
buildInputs = [
rustToolchain
pkgs.wayland
pkgs.alsa-lib
pkgs.libudev-zero
];
nativeBuildInputs = with pkgs; [ pkg-config ];
shellHook = ''
echo "${packageName} v${packageVersion}"
echo "Bevy v${bevyVersion}"
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"
'';
};
};
}

3
src/main.rs Normal file
View File

@@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}