Add initial project structure with Rust Nix flake template
- Create .envrc for Direnv configuration - Add .pre-commit-config.yaml for pre-commit hooks - Include CONTRIBUTING.md for contribution guidelines - Initialize Cargo.toml for Rust package configuration - Update LICENSE to link to full license text - Create Makefile for build, run, test, and clean commands - Revise README.md for project description and usage instructions - Implement default Nix flake configuration in flake.nix - Add Flatpak manifest for packaging - Set up project metadata in project.toml - Create shell.nix for legacy shell support - Add skeletal Rust application in src/main.rs - Include sample test in tests/sample_test.rs
This commit is contained in:
+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;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user