From 31e102a4eec88239f5572012ae813ebb6dcd646a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=BCller?= Date: Wed, 4 Mar 2026 17:29:18 +0100 Subject: [PATCH] Initial Commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marcel Müller --- .gitignore | 7 ++++ Cargo.toml | 6 +++ flake.lock | 97 +++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 4 +- rust-toolchain.toml | 2 +- src/lib.rs | 14 +++++++ 6 files changed, 126 insertions(+), 4 deletions(-) create mode 100644 Cargo.toml create mode 100644 flake.lock create mode 100644 src/lib.rs diff --git a/.gitignore b/.gitignore index defb674..823912a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,10 @@ # Nix /result* + + +# Added by cargo +# +# already existing elements were commented out + +#/target diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..c504515 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "temple" +version = "0.1.0" +edition = "2024" + +[dependencies] diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..9930d69 --- /dev/null +++ b/flake.lock @@ -0,0 +1,97 @@ +{ + "nodes": { + "crane": { + "locked": { + "lastModified": 1772560058, + "narHash": "sha256-NuVKdMBJldwUXgghYpzIWJdfeB7ccsu1CC7B+NfSoZ8=", + "owner": "ipetkov", + "repo": "crane", + "rev": "db590d9286ed5ce22017541e36132eab4e8b3045", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1772598333, + "narHash": "sha256-YaHht/C35INEX3DeJQNWjNaTcPjYmBwwjFJ2jdtr+5U=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "fabb8c9deee281e50b1065002c9828f2cf7b2239", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "ref": "nixos-25.11", + "type": "indirect" + } + }, + "root": { + "inputs": { + "crane": "crane", + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "rust-overlay": "rust-overlay" + } + }, + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1772593411, + "narHash": "sha256-47WOnCSyOL6AghZiMIJaTLWM359DHe3be9R1cNCdGUE=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "a741b36b77440f5db15fcf2ab6d7d592d2f9ee8f", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix index c703695..0664197 100644 --- a/flake.nix +++ b/flake.nix @@ -1,19 +1,17 @@ { description = "library"; inputs = { - nixpkgs.url = "nixpkgs/nixos-24.05"; + nixpkgs.url = "nixpkgs/nixos-25.11"; flake-utils = { url = "github:numtide/flake-utils"; }; crane = { url = "github:ipetkov/crane"; - inputs.nixpkgs.follows = "nixpkgs"; }; rust-overlay = { url = "github:oxalica/rust-overlay"; inputs = { nixpkgs.follows = "nixpkgs"; - flake-utils.follows = "flake-utils"; }; }; }; diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 2e2b8c8..5355133 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.82.0" +channel = "1.93.1" diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..b93cf3f --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: u64, right: u64) -> u64 { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +}