Setting up still
This commit is contained in:
Generated
+10
@@ -0,0 +1,10 @@
|
|||||||
|
# Default ignored files
|
||||||
|
/shelf/
|
||||||
|
/workspace.xml
|
||||||
|
# Editor-based HTTP Client requests
|
||||||
|
/httpRequests/
|
||||||
|
# Ignored default folder with query files
|
||||||
|
/queries/
|
||||||
|
# Datasource local storage ignored files
|
||||||
|
/dataSources/
|
||||||
|
/dataSources.local.xml
|
||||||
+13
@@ -0,0 +1,13 @@
|
|||||||
|
[package]
|
||||||
|
name = "game_kt"
|
||||||
|
version = "0.0.1"
|
||||||
|
edition = "2024"
|
||||||
|
description = "A console logging library for Rust applications"
|
||||||
|
license = "MIT"
|
||||||
|
publish = ["gitea"]
|
||||||
|
autobins = false
|
||||||
|
|
||||||
|
[lib]
|
||||||
|
name = "game_kt"
|
||||||
|
path = "src/lib.rs"
|
||||||
|
|
||||||
@@ -0,0 +1,122 @@
|
|||||||
|
{
|
||||||
|
description = "Rust development environment for the game_kt console logging library";
|
||||||
|
|
||||||
|
inputs = {
|
||||||
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
|
fenix = {
|
||||||
|
url = "github:nix-community/fenix";
|
||||||
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
outputs =
|
||||||
|
inputs@{ self, ... }:
|
||||||
|
let
|
||||||
|
supportedSystems = [
|
||||||
|
"x86_64-linux"
|
||||||
|
"aarch64-linux"
|
||||||
|
"x86_64-darwin"
|
||||||
|
"aarch64-darwin"
|
||||||
|
];
|
||||||
|
forEachSupportedSystem =
|
||||||
|
f:
|
||||||
|
inputs.nixpkgs.lib.genAttrs supportedSystems (
|
||||||
|
system:
|
||||||
|
f {
|
||||||
|
pkgs = import inputs.nixpkgs {
|
||||||
|
inherit system;
|
||||||
|
overlays = [
|
||||||
|
inputs.self.overlays.default
|
||||||
|
];
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
in
|
||||||
|
{
|
||||||
|
templates = {
|
||||||
|
default = {
|
||||||
|
path = ./.;
|
||||||
|
description = "Rust library development environment using fenix";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
overlays.default = _final: prev: {
|
||||||
|
rustToolchain =
|
||||||
|
with inputs.fenix.packages.${prev.stdenv.hostPlatform.system};
|
||||||
|
combine (
|
||||||
|
with stable;
|
||||||
|
[
|
||||||
|
cargo
|
||||||
|
clippy
|
||||||
|
rustc
|
||||||
|
rustfmt
|
||||||
|
rust-src
|
||||||
|
]
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
devShells = forEachSupportedSystem (
|
||||||
|
{ pkgs }:
|
||||||
|
{
|
||||||
|
default = pkgs.mkShell {
|
||||||
|
packages = with pkgs; [
|
||||||
|
rustToolchain
|
||||||
|
git
|
||||||
|
gnumake
|
||||||
|
alejandra
|
||||||
|
statix
|
||||||
|
deadnix
|
||||||
|
openssl
|
||||||
|
pkg-config
|
||||||
|
cargo-deny
|
||||||
|
cargo-edit
|
||||||
|
cargo-watch
|
||||||
|
rust-analyzer
|
||||||
|
pre-commit
|
||||||
|
];
|
||||||
|
|
||||||
|
env = {
|
||||||
|
RUST_SRC_PATH = "${pkgs.rustToolchain}/lib/rustlib/src/rust/library";
|
||||||
|
};
|
||||||
|
|
||||||
|
shellHook = ''
|
||||||
|
if [ ! -d .git ]; then
|
||||||
|
git init
|
||||||
|
echo "✓ Initialized git repository"
|
||||||
|
fi
|
||||||
|
|
||||||
|
export PATH="$HOME/.cargo/bin:$PATH"
|
||||||
|
|
||||||
|
echo "[game_kt] Welcome to the Rust library development shell!"
|
||||||
|
echo "Tools: cargo, rustc, clippy, rustfmt, rust-analyzer"
|
||||||
|
echo "Run 'cargo test', 'cargo clippy', or 'cargo build' to work on the library."
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
packages = forEachSupportedSystem (
|
||||||
|
{ pkgs }:
|
||||||
|
{
|
||||||
|
default = pkgs.rustPlatform.buildRustPackage {
|
||||||
|
pname = "game_kt";
|
||||||
|
version = "0.1.0";
|
||||||
|
src = ./.;
|
||||||
|
cargoLock.lockFile = ./Cargo.lock;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
checks = forEachSupportedSystem (
|
||||||
|
{ pkgs }:
|
||||||
|
{
|
||||||
|
default = self.packages.${pkgs.stdenv.hostPlatform.system}.default;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
formatter = forEachSupportedSystem (
|
||||||
|
{ pkgs }:
|
||||||
|
pkgs.alejandra
|
||||||
|
);
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user