added stuff

This commit is contained in:
Charlie Root 2024-04-09 23:11:33 +02:00
commit 9d0ebdfbd0
907 changed files with 70990 additions and 0 deletions

View file

@ -0,0 +1,5 @@
[package]
name = "sample-rust"
version = "0.0.1"
license = "MIT"
edition = "2021"

View file

@ -0,0 +1,8 @@
{rustPlatform}:
rustPlatform.buildRustPackage {
pname = "sample-rust";
version = "0.0.1";
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
}

View file

@ -0,0 +1,26 @@
{
description = "Rust Project Template";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs";
};
outputs = {
self,
nixpkgs,
}: let
systems = ["x86_64-linux" "aarch64-linux"];
forEachSystem = nixpkgs.lib.genAttrs systems;
pkgsForEach = nixpkgs.legacyPackages;
in rec {
packages = forEachSystem (system: {
default = pkgsForEach.${system}.callPackage ./default.nix {};
});
devShells = forEachSystem (system: {
default = pkgsForEach.${system}.callPackage ./shell.nix {};
});
hydraJobs = packages;
};
}

View file

@ -0,0 +1,20 @@
{
callPackage,
rust-analyzer,
rustfmt,
clippy,
cargo,
}: let
mainPkg = callPackage ./default.nix {};
in
mainPkg.overrideAttrs (oa: {
nativeBuildInputs =
[
# Additional rust tooling
rust-analyzer
rustfmt
clippy
cargo
]
++ (oa.nativeBuildInputs or []);
})

View file

@ -0,0 +1,3 @@
fn main() {
println!("Hello, world!");
}