Compare commits

..

1 Commits

8 changed files with 71 additions and 36 deletions
+11 -1
View File
@@ -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
View File
@@ -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"
+1
View File
@@ -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"
+5
View File
@@ -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
+28
View File
@@ -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.
+13 -24
View File
@@ -1,29 +1,18 @@
{ pkgs }: { pkgs ? import <nixpkgs> { } }:
let
lib = pkgs.lib; pkgs.rustPlatform.buildRustPackage {
templateName = builtins.baseNameOf (toString ./.); pname = "r_eom";
in
{
${templateName} = pkgs.stdenvNoCC.mkDerivation {
pname = templateName;
version = "0.1.0"; version = "0.1.0";
src = ./.; src = ./.;
dontBuild = true;
installPhase = '' cargoLock = {
mkdir -p $out/share/${templateName} lockFile = ./Cargo.lock;
if [ -d src ]; then };
cp -r src $out/share/${templateName}/
fi meta = with pkgs.lib; {
for f in README.md project.toml flake.nix default.nix shell.nix Makefile .editorconfig .gitignore; do description = "R_EoM library with a demo platform for testing and showcasing its features";
if [ -f "$f" ]; then license = licenses.cc-by-sa-40;
cp "$f" $out/share/${templateName}/
fi
done
'';
meta = with lib; {
description = "Template project: ${templateName}";
license = licenses.unfreeRedistributable;
platforms = platforms.all; platforms = platforms.all;
}; };
};
} }
+2 -7
View File
@@ -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
View File
@@ -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"