added stuff
This commit is contained in:
parent
937f28770d
commit
236b8c2a6b
907 changed files with 70990 additions and 0 deletions
5
nyx/flake/templates/rust/Cargo.toml
Normal file
5
nyx/flake/templates/rust/Cargo.toml
Normal file
|
@ -0,0 +1,5 @@
|
|||
[package]
|
||||
name = "sample-rust"
|
||||
version = "0.0.1"
|
||||
license = "MIT"
|
||||
edition = "2021"
|
8
nyx/flake/templates/rust/default.nix
Normal file
8
nyx/flake/templates/rust/default.nix
Normal file
|
@ -0,0 +1,8 @@
|
|||
{rustPlatform}:
|
||||
rustPlatform.buildRustPackage {
|
||||
pname = "sample-rust";
|
||||
version = "0.0.1";
|
||||
|
||||
src = ./.;
|
||||
cargoLock.lockFile = ./Cargo.lock;
|
||||
}
|
26
nyx/flake/templates/rust/flake.nix
Normal file
26
nyx/flake/templates/rust/flake.nix
Normal 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;
|
||||
};
|
||||
}
|
20
nyx/flake/templates/rust/shell.nix
Normal file
20
nyx/flake/templates/rust/shell.nix
Normal 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 []);
|
||||
})
|
3
nyx/flake/templates/rust/src/main.rs
Normal file
3
nyx/flake/templates/rust/src/main.rs
Normal file
|
@ -0,0 +1,3 @@
|
|||
fn main() {
|
||||
println!("Hello, world!");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue