Compare commits
1 Commits
20b8bcdb63
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| bb012b2ca9 |
+11
-1
@@ -1,11 +1,21 @@
|
|||||||
# Rust build artifacts
|
# Rust build artifacts
|
||||||
/target/
|
/target/
|
||||||
Cargo.lock
|
Cargo.toml.orig
|
||||||
|
|
||||||
# IDE
|
# IDE
|
||||||
.vscode/
|
.vscode/
|
||||||
.idea/
|
.idea/
|
||||||
|
*.swp
|
||||||
|
*~
|
||||||
|
|
||||||
# Nix
|
# Nix
|
||||||
result
|
result
|
||||||
|
result-*
|
||||||
.direnv/
|
.direnv/
|
||||||
|
|
||||||
|
# Flatpak
|
||||||
|
build-flatpak/
|
||||||
|
|
||||||
|
# System Files
|
||||||
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
|
|||||||
Generated
+7
@@ -0,0 +1,7 @@
|
|||||||
|
# This file is automatically @generated by Cargo.
|
||||||
|
# It is not intended for manual editing.
|
||||||
|
version = 4
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "r_eom"
|
||||||
|
version = "0.1.0"
|
||||||
@@ -3,6 +3,7 @@ name = "r_eom"
|
|||||||
description = "R_EoM library with a demo platform for testing and showcasing its features"
|
description = "R_EoM library with a demo platform for testing and showcasing its features"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
license = "CC-BY-SA-4.0"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
name = "r_eom"
|
name = "r_eom"
|
||||||
|
|||||||
@@ -17,3 +17,8 @@ clean:
|
|||||||
.PHONY: flatpak-build
|
.PHONY: flatpak-build
|
||||||
flatpak-build:
|
flatpak-build:
|
||||||
flatpak-builder --force-clean build-flatpak flatpak/app.flatpak.json
|
flatpak-builder --force-clean build-flatpak flatpak/app.flatpak.json
|
||||||
|
|
||||||
|
# Nix build target
|
||||||
|
.PHONY: nix-build
|
||||||
|
nix-build:
|
||||||
|
nix build .#default
|
||||||
|
|||||||
@@ -36,6 +36,30 @@ To run tests:
|
|||||||
cargo test
|
cargo test
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Nix
|
||||||
|
|
||||||
|
This project provides Nix support via flakes and a traditional `default.nix`.
|
||||||
|
|
||||||
|
To build the project using Nix:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nix build
|
||||||
|
```
|
||||||
|
|
||||||
|
To run the demo platform using Nix:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nix run
|
||||||
|
```
|
||||||
|
|
||||||
|
To enter a development shell:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
nix develop
|
||||||
|
```
|
||||||
|
|
||||||
|
(or `nix-shell` for non-flake users)
|
||||||
|
|
||||||
### Flatpak
|
### Flatpak
|
||||||
|
|
||||||
To build the Flatpak:
|
To build the Flatpak:
|
||||||
@@ -55,3 +79,7 @@ This project includes shared run configurations in the `.run` directory. When yo
|
|||||||
|
|
||||||
Additionally, the IDE automatically detects all targets defined in `Cargo.toml`.
|
Additionally, the IDE automatically detects all targets defined in `Cargo.toml`.
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
This project is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License - see the [LICENSE](LICENSE) file for details.
|
||||||
|
|
||||||
|
|||||||
+16
-27
@@ -1,29 +1,18 @@
|
|||||||
{ pkgs }:
|
{ pkgs ? import <nixpkgs> { } }:
|
||||||
let
|
|
||||||
lib = pkgs.lib;
|
pkgs.rustPlatform.buildRustPackage {
|
||||||
templateName = builtins.baseNameOf (toString ./.);
|
pname = "r_eom";
|
||||||
in
|
version = "0.1.0";
|
||||||
{
|
|
||||||
${templateName} = pkgs.stdenvNoCC.mkDerivation {
|
src = ./.;
|
||||||
pname = templateName;
|
|
||||||
version = "0.1.0";
|
cargoLock = {
|
||||||
src = ./.;
|
lockFile = ./Cargo.lock;
|
||||||
dontBuild = true;
|
};
|
||||||
installPhase = ''
|
|
||||||
mkdir -p $out/share/${templateName}
|
meta = with pkgs.lib; {
|
||||||
if [ -d src ]; then
|
description = "R_EoM library with a demo platform for testing and showcasing its features";
|
||||||
cp -r src $out/share/${templateName}/
|
license = licenses.cc-by-sa-40;
|
||||||
fi
|
platforms = platforms.all;
|
||||||
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;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -126,13 +126,8 @@
|
|||||||
packages = forEachSupportedSystem (
|
packages = forEachSupportedSystem (
|
||||||
{ pkgs }:
|
{ pkgs }:
|
||||||
{
|
{
|
||||||
# Build the skeletal Cargo project
|
# Build the r_eom package
|
||||||
default = pkgs.rustPlatform.buildRustPackage {
|
default = pkgs.callPackage ./default.nix { };
|
||||||
pname = "sample-rust-app";
|
|
||||||
version = "0.1.0";
|
|
||||||
src = ./.;
|
|
||||||
cargoLock.lockFile = ./Cargo.lock;
|
|
||||||
};
|
|
||||||
|
|
||||||
devHelper = pkgs.writeShellScriptBin "dev-helper" ''
|
devHelper = pkgs.writeShellScriptBin "dev-helper" ''
|
||||||
echo "Rust toolchain available:"
|
echo "Rust toolchain available:"
|
||||||
|
|||||||
+1
-1
@@ -3,4 +3,4 @@ name = "r_eom"
|
|||||||
description = "R_EoM library with a demo platform for testing and showcasing its features"
|
description = "R_EoM library with a demo platform for testing and showcasing its features"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
authors = ["gooba42 <your@email>"]
|
authors = ["gooba42 <your@email>"]
|
||||||
license = "MIT"
|
license = "CC-BY-SA-4.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user