fix rust template

This commit is contained in:
Jonas Röger 2025-03-16 18:24:13 +01:00
parent e2c38ef18e
commit ba364b8195
Signed by: jonas
GPG Key ID: 4000EB35E1AE0F07
4 changed files with 8 additions and 15 deletions

View File

@ -1,6 +1,6 @@
[package] [package]
name = "RustBinary" name = "hello"
description = "A rust binary" description = "A test rust binary"
publish = false publish = false
version = "0.1.0" version = "0.1.0"

View File

@ -1,8 +1,8 @@
{ {
description = "Rust-Nix"; description = "Rust-Hello";
inputs = { inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/unstable"; nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
rust-overlay = { rust-overlay = {
url = "github:oxalica/rust-overlay"; url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
@ -32,7 +32,7 @@
# Use rust-bin to generate the toolchain from rust-toolchain.toml # Use rust-bin to generate the toolchain from rust-toolchain.toml
rust-toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml; rust-toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
buildRustCrateForPkgs = pkgs: buildRustCrateForPkgs = _:
pkgs.buildRustCrate.override { pkgs.buildRustCrate.override {
rustc = rust-toolchain; # Use rustc from toolchain rustc = rust-toolchain; # Use rustc from toolchain
cargo = rust-toolchain; # Use cargo from toolchain cargo = rust-toolchain; # Use cargo from toolchain
@ -52,6 +52,7 @@
hello = cargoNix.rootCrate.build; hello = cargoNix.rootCrate.build;
default = hello; default = hello;
}; };
devShell = pkgs.mkShell { devShell = pkgs.mkShell {
buildInputs = [rust-toolchain]; buildInputs = [rust-toolchain];
}; };

View File

@ -1,3 +1,3 @@
[toolchain] [toolchain]
channel = "1.80.1" channel = "1.85.0"
components = [ "rustfmt", "rustc-dev", "rust-analyzer", "rust-src"] components = [ "rustfmt", "rustc-dev", "rust-analyzer", "rust-src"]

View File

@ -1,11 +1,3 @@
use colored::*;
fn main() { fn main() {
println!("{}", "Hello, world!".red()); println!("{}", "Hello, world!");
println!("{}", "Hello, world!".green());
println!("{}", "Hello, world!".yellow());
println!("{}", "Hello, world!".blue());
println!("{}", "Hello, world!".purple());
println!("{}", "Hello, world!".cyan());
println!("{}", "Hello, world!".white());
} }