Updated license and project setup to enable nixpkgs build and development.
This commit is contained in:
+11
-1
@@ -1,11 +1,21 @@
|
||||
# Rust build artifacts
|
||||
/target/
|
||||
Cargo.lock
|
||||
Cargo.toml.orig
|
||||
|
||||
# IDE
|
||||
.vscode/
|
||||
.idea/
|
||||
*.swp
|
||||
*~
|
||||
|
||||
# Nix
|
||||
result
|
||||
result-*
|
||||
.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"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
license = "CC-BY-SA-4.0"
|
||||
|
||||
[lib]
|
||||
name = "r_eom"
|
||||
|
||||
@@ -17,3 +17,8 @@ clean:
|
||||
.PHONY: flatpak-build
|
||||
flatpak-build:
|
||||
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
|
||||
```
|
||||
|
||||
### 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
|
||||
|
||||
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`.
|
||||
|
||||
## 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 }:
|
||||
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;
|
||||
};
|
||||
{ pkgs ? import <nixpkgs> { } }:
|
||||
|
||||
pkgs.rustPlatform.buildRustPackage {
|
||||
pname = "r_eom";
|
||||
version = "0.1.0";
|
||||
|
||||
src = ./.;
|
||||
|
||||
cargoLock = {
|
||||
lockFile = ./Cargo.lock;
|
||||
};
|
||||
|
||||
meta = with pkgs.lib; {
|
||||
description = "R_EoM library with a demo platform for testing and showcasing its features";
|
||||
license = licenses.cc-by-sa-40;
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -126,13 +126,8 @@
|
||||
packages = forEachSupportedSystem (
|
||||
{ pkgs }:
|
||||
{
|
||||
# Build the skeletal Cargo project
|
||||
default = pkgs.rustPlatform.buildRustPackage {
|
||||
pname = "sample-rust-app";
|
||||
version = "0.1.0";
|
||||
src = ./.;
|
||||
cargoLock.lockFile = ./Cargo.lock;
|
||||
};
|
||||
# Build the r_eom package
|
||||
default = pkgs.callPackage ./default.nix { };
|
||||
|
||||
devHelper = pkgs.writeShellScriptBin "dev-helper" ''
|
||||
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"
|
||||
version = "0.1.0"
|
||||
authors = ["gooba42 <your@email>"]
|
||||
license = "MIT"
|
||||
license = "CC-BY-SA-4.0"
|
||||
|
||||
Reference in New Issue
Block a user