Compare commits
6
Commits
f2da6969e6
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d968a65386 | ||
|
|
6ac3fd046b | ||
|
|
22897b3d68 | ||
|
|
fa6c652f29 | ||
|
|
5b59d88f04 | ||
|
|
45605478f8 |
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
flake-profile-2-link
|
||||||
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
/nix/store/nzs5pmy9n7c63z9bi62rl9qzkz7xbdpb-nix-shell-env
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# EditorConfig for Rust template
|
||||||
|
root = false
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
|
insert_final_newline = true
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
trim_trailing_whitespace = true
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
# .gitea/workflows/build.yml
|
||||||
|
name: cargo build
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- master
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: nix
|
||||||
|
env:
|
||||||
|
CARGO_TARGET_DIR: /tmp/game_kt-target
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Build crate (Nix dev shell)
|
||||||
|
run: nix develop --extra-experimental-features "nix-command flakes" -c cargo build --verbose
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
# .gitea/workflows/test.yml
|
||||||
|
name: cargo test
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- master
|
||||||
|
tags:
|
||||||
|
- v*
|
||||||
|
pull_request:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test:
|
||||||
|
runs-on: nix
|
||||||
|
env:
|
||||||
|
CARGO_TARGET_DIR: /tmp/game_kt-target
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Run tests (Nix dev shell)
|
||||||
|
run: nix develop --extra-experimental-features "nix-command flakes" -c cargo test --verbose
|
||||||
|
|
||||||
|
publish:
|
||||||
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
|
needs: test
|
||||||
|
runs-on: nix
|
||||||
|
env:
|
||||||
|
CARGO_TARGET_DIR: /tmp/game_kt-target
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Configure Cargo registry (Gitea)
|
||||||
|
run: |
|
||||||
|
mkdir -p ~/.cargo
|
||||||
|
cat > ~/.cargo/config.toml << 'EOF'
|
||||||
|
[registries.gitea]
|
||||||
|
index = "sparse+https://git.moturpin.com/api/packages/Matsubaa/cargo/"
|
||||||
|
EOF
|
||||||
|
|
||||||
|
- name: Publish to Gitea Cargo registry
|
||||||
|
env:
|
||||||
|
CARGO_REGISTRIES_GITEA_TOKEN: "Bearer ${{ secrets.CARGO_TOKEN }}"
|
||||||
|
run: nix develop --extra-experimental-features "nix-command flakes" -c cargo publish --registry gitea --verbose
|
||||||
Generated
+6
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="uk.co.ben_gibson.git.link.SettingsState">
|
||||||
|
<option name="host" value="e0f86390-1091-4871-8aeb-f534fbc99cf0" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+12
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<module type="EMPTY_MODULE" version="4">
|
||||||
|
<component name="NewModuleRootManager">
|
||||||
|
<content url="file://$MODULE_DIR$">
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
||||||
|
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" />
|
||||||
|
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||||
|
</content>
|
||||||
|
<orderEntry type="inheritedJdk" />
|
||||||
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
</component>
|
||||||
|
</module>
|
||||||
+13
@@ -0,0 +1,13 @@
|
|||||||
|
<component name="InspectionProjectProfileManager">
|
||||||
|
<profile version="1.0">
|
||||||
|
<option name="myName" value="Project Default" />
|
||||||
|
<inspection_tool class="PyUnresolvedReferencesInspection" enabled="true" level="WARNING" enabled_by_default="true">
|
||||||
|
<option name="ignoredIdentifiers">
|
||||||
|
<list>
|
||||||
|
<option value="neopixel" />
|
||||||
|
<option value="board" />
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</inspection_tool>
|
||||||
|
</profile>
|
||||||
|
</component>
|
||||||
Generated
+28
@@ -0,0 +1,28 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="JsonSchemaMappingsProjectConfiguration">
|
||||||
|
<state>
|
||||||
|
<map>
|
||||||
|
<entry key="GitHub Workflow">
|
||||||
|
<value>
|
||||||
|
<SchemaInfo>
|
||||||
|
<option name="name" value="GitHub Workflow" />
|
||||||
|
<option name="relativePathToSchema" value="https://www.schemastore.org/github-workflow.json" />
|
||||||
|
<option name="applicationDefined" value="true" />
|
||||||
|
<option name="patterns">
|
||||||
|
<list>
|
||||||
|
<Item>
|
||||||
|
<option name="path" value=".gitea/workflows/build.yml" />
|
||||||
|
</Item>
|
||||||
|
<Item>
|
||||||
|
<option name="path" value=".gitea/workflows/test.yml" />
|
||||||
|
</Item>
|
||||||
|
</list>
|
||||||
|
</option>
|
||||||
|
</SchemaInfo>
|
||||||
|
</value>
|
||||||
|
</entry>
|
||||||
|
</map>
|
||||||
|
</state>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+8
@@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ProjectModuleManager">
|
||||||
|
<modules>
|
||||||
|
<module fileurl="file://$PROJECT_DIR$/.idea/game-kt.iml" filepath="$PROJECT_DIR$/.idea/game-kt.iml" />
|
||||||
|
</modules>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Generated
+6
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
repos:
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
rev: v4.4.0
|
||||||
|
hooks:
|
||||||
|
- id: trailing-whitespace
|
||||||
|
- id: end-of-file-fixer
|
||||||
|
- id: check-yaml
|
||||||
|
- id: check-added-large-files
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# Contributing
|
||||||
|
|
||||||
|
Thank you for considering contributing!
|
||||||
|
|
||||||
|
- Please follow the project coding style and directory structure.
|
||||||
|
- Submit issues or pull requests for bugs, features, or improvements.
|
||||||
|
- Add tests for new features where possible.
|
||||||
|
- Ensure your code builds and passes tests before submitting.
|
||||||
|
- Contributions are licensed under CC BY-SA 4.0.
|
||||||
Generated
+7
@@ -0,0 +1,7 @@
|
|||||||
|
# This file is automatically @generated by Cargo.
|
||||||
|
# It is not intended for manual editing.
|
||||||
|
version = 4
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "game_kt"
|
||||||
|
version = "0.0.1"
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
Creative Commons Attribution-ShareAlike 4.0 International
|
||||||
|
|
||||||
|
<https://creativecommons.org/licenses/by-sa/4.0/>
|
||||||
|
|
||||||
|
You are free to:
|
||||||
|
|
||||||
|
- Share — copy and redistribute the material in any medium or format
|
||||||
|
- Adapt — remix, transform, and build upon the material for any purpose, even commercially.
|
||||||
|
|
||||||
|
Under the following terms:
|
||||||
|
|
||||||
|
- Attribution — You must give appropriate credit, provide a link to the license, and indicate if changes were made.
|
||||||
|
- ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.
|
||||||
|
|
||||||
|
No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
|
||||||
|
|
||||||
|
See the full license at the link above.
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
build:
|
||||||
|
cargo build
|
||||||
|
|
||||||
|
run:
|
||||||
|
cargo run
|
||||||
|
|
||||||
|
test:
|
||||||
|
cargo test
|
||||||
|
|
||||||
|
clean:
|
||||||
|
cargo clean
|
||||||
|
|
||||||
|
.PHONY: build run test clean
|
||||||
|
|
||||||
|
|
||||||
|
# Flatpak build target
|
||||||
|
.PHONY: flatpak-build
|
||||||
|
flatpak-build:
|
||||||
|
flatpak-builder --force-clean build-flatpak flatpak/app.flatpak.json
|
||||||
@@ -1,2 +1,3 @@
|
|||||||
# game-kt
|
# game-kt
|
||||||
|
[](https://git.moturpin.com/Matsubaa/game-kt/actions?workflow=build.yml)
|
||||||
|
[](https://git.moturpin.com/Matsubaa/game-kt/actions?workflow=test.yml)
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
# Coding Agent Instructions
|
||||||
|
|
||||||
|
This project is intended for educational purposes. To support this, please adhere to the following guidelines:
|
||||||
|
|
||||||
|
## Allowed Actions
|
||||||
|
- **Environment Maintenance:** Feel free to update Nix flakes, shell configurations, or other environment-related setup.
|
||||||
|
- **Project Housekeeping:** Maintain a standard project layout, keep `README.md` up-to-date, and clean up temporary or build-related files.
|
||||||
|
- **Documentation:** Add comments, manage project documentation, and add links to relevant external resources.
|
||||||
|
|
||||||
|
## Restricted Actions
|
||||||
|
- **Source Code Editing:** You are NOT allowed to edit the executable source code (`src/` directory) except to improve documentation..
|
||||||
|
- **Code Generation:** Do not provide example code unless explicitly asked by the user.
|
||||||
|
|
||||||
|
## Communication Guidelines
|
||||||
|
- **Educational Focus:** When asked about code, prioritize explaining the concepts and providing advice over writing code.
|
||||||
|
- **Documentation Links:** Always include links to official language or library documentation for references.
|
||||||
+29
@@ -0,0 +1,29 @@
|
|||||||
|
{ pkgs }:
|
||||||
|
let
|
||||||
|
lib = pkgs.lib;
|
||||||
|
templateName = builtins.baseNameOf (toString ./.);
|
||||||
|
in
|
||||||
|
{
|
||||||
|
${templateName} = pkgs.stdenvNoCC.mkDerivation {
|
||||||
|
pname = templateName;
|
||||||
|
version = "0.1.0";
|
||||||
|
src = ./.;
|
||||||
|
dontBuild = true;
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p $out/share/${templateName}
|
||||||
|
if [ -d src ]; then
|
||||||
|
cp -r src $out/share/${templateName}/
|
||||||
|
fi
|
||||||
|
for f in README.md project.toml flake.nix default.nix shell.nix Makefile .editorconfig .gitignore; do
|
||||||
|
if [ -f "$f" ]; then
|
||||||
|
cp "$f" $out/share/${templateName}/
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
meta = with lib; {
|
||||||
|
description = "Template project: ${templateName}";
|
||||||
|
license = licenses.unfreeRedistributable;
|
||||||
|
platforms = platforms.all;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Generated
+66
@@ -0,0 +1,66 @@
|
|||||||
|
{
|
||||||
|
"nodes": {
|
||||||
|
"fenix": {
|
||||||
|
"inputs": {
|
||||||
|
"nixpkgs": [
|
||||||
|
"nixpkgs"
|
||||||
|
],
|
||||||
|
"rust-analyzer-src": "rust-analyzer-src"
|
||||||
|
},
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1787941560,
|
||||||
|
"narHash": "sha256-dMvXIG1IrbpolQY6+4u5lxqtPPQWVVNPGwSh9Vy6fIA=",
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "fenix",
|
||||||
|
"rev": "2810303efc016eb3dcf9d3176c65ac732409fdbf",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-community",
|
||||||
|
"repo": "fenix",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nixpkgs": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1787736819,
|
||||||
|
"narHash": "sha256-cV5xEJJK3BvhU8rEd4mC9UsmDi5qscv/kzGPhBRC5WA=",
|
||||||
|
"owner": "NixOS",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"rev": "9fbb54b33e91ee4ca368e35a78e0613c720600b3",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "NixOS",
|
||||||
|
"ref": "nixos-unstable",
|
||||||
|
"repo": "nixpkgs",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": {
|
||||||
|
"inputs": {
|
||||||
|
"fenix": "fenix",
|
||||||
|
"nixpkgs": "nixpkgs"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"rust-analyzer-src": {
|
||||||
|
"flake": false,
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1787768781,
|
||||||
|
"narHash": "sha256-PMVtb917DTWjGLTQHHI+ATUguk7Wxuqu6J+DINiU+qI=",
|
||||||
|
"owner": "rust-lang",
|
||||||
|
"repo": "rust-analyzer",
|
||||||
|
"rev": "70d74f4d134c45b073c82167fb7e7d61334bd8f5",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "rust-lang",
|
||||||
|
"ref": "nightly",
|
||||||
|
"repo": "rust-analyzer",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"root": "root",
|
||||||
|
"version": 7
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"app-id": "org.example.rustdevshell",
|
||||||
|
"runtime": "org.freedesktop.Platform",
|
||||||
|
"runtime-version": "23.08",
|
||||||
|
"sdk": "org.freedesktop.Sdk",
|
||||||
|
"command": "rustdevshell-app",
|
||||||
|
"modules": [
|
||||||
|
{
|
||||||
|
"name": "rustdevshell-app",
|
||||||
|
"buildsystem": "simple",
|
||||||
|
"build-commands": [
|
||||||
|
"cargo build --release"
|
||||||
|
],
|
||||||
|
"sources": [
|
||||||
|
{
|
||||||
|
"type": "dir",
|
||||||
|
"path": ".."
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
[project]
|
||||||
|
name = "rust-template"
|
||||||
|
description = "A reusable Nix flake template for Rust development."
|
||||||
|
version = "0.1.0"
|
||||||
|
authors = ["gooba42 <your@email>"]
|
||||||
|
license = "MIT"
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
pkgs ? import <nixpkgs> { },
|
||||||
|
}:
|
||||||
|
pkgs.mkShell {
|
||||||
|
buildInputs = [
|
||||||
|
pkgs.rustc
|
||||||
|
pkgs.cargo
|
||||||
|
pkgs.rustfmt
|
||||||
|
pkgs.clippy
|
||||||
|
pkgs.rust-analyzer
|
||||||
|
];
|
||||||
|
shellHook = ''
|
||||||
|
echo "[shell.nix] Legacy shell for Rust dev. Use 'nix develop' for full flake support."
|
||||||
|
'';
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
#[test]
|
||||||
|
fn test_sample() {
|
||||||
|
assert_eq!(1, 1);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user