From 83428f97f5c29a80ba934fdd77e989d4d4cb9cb4 Mon Sep 17 00:00:00 2001 From: Tao Tien <29749622+taotien@users.noreply.github.com> Date: Mon, 25 May 2026 17:50:39 -0700 Subject: [PATCH] init --- .gitignore | 12 +++++ Cargo.lock | 15 ++++++ Cargo.toml | 3 ++ combustcean-core/Cargo.toml | 6 +++ combustcean-core/src/lib.rs | 14 ++++++ combustcean-range/Cargo.toml | 6 +++ combustcean-range/src/main.rs | 3 ++ combustcean-tongs/Cargo.toml | 6 +++ combustcean-tongs/src/main.rs | 3 ++ devenv.lock | 86 +++++++++++++++++++++++++++++++++++ devenv.nix | 25 ++++++++++ devenv.yaml | 8 ++++ 12 files changed, 187 insertions(+) create mode 100644 .gitignore create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 combustcean-core/Cargo.toml create mode 100644 combustcean-core/src/lib.rs create mode 100644 combustcean-range/Cargo.toml create mode 100644 combustcean-range/src/main.rs create mode 100644 combustcean-tongs/Cargo.toml create mode 100644 combustcean-tongs/src/main.rs create mode 100644 devenv.lock create mode 100644 devenv.nix create mode 100644 devenv.yaml diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4265d8d --- /dev/null +++ b/.gitignore @@ -0,0 +1,12 @@ +target/ + +# Devenv +.devenv* +devenv.local.nix +devenv.local.yaml + +# direnv +.direnv + +# pre-commit +.pre-commit-config.yaml diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..25d9807 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,15 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "combustcean-core" +version = "0.1.0" + +[[package]] +name = "combustcean-range" +version = "0.1.0" + +[[package]] +name = "combustcean-tongs" +version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..66b8422 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,3 @@ +[workspace] +resolver = "3" +members = ["combustcean-core", "combustcean-range", "combustcean-tongs"] diff --git a/combustcean-core/Cargo.toml b/combustcean-core/Cargo.toml new file mode 100644 index 0000000..397fbf4 --- /dev/null +++ b/combustcean-core/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "combustcean-core" +version = "0.1.0" +edition = "2024" + +[dependencies] diff --git a/combustcean-core/src/lib.rs b/combustcean-core/src/lib.rs new file mode 100644 index 0000000..b93cf3f --- /dev/null +++ b/combustcean-core/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); + } +} diff --git a/combustcean-range/Cargo.toml b/combustcean-range/Cargo.toml new file mode 100644 index 0000000..ba1a563 --- /dev/null +++ b/combustcean-range/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "combustcean-range" +version = "0.1.0" +edition = "2024" + +[dependencies] diff --git a/combustcean-range/src/main.rs b/combustcean-range/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/combustcean-range/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} diff --git a/combustcean-tongs/Cargo.toml b/combustcean-tongs/Cargo.toml new file mode 100644 index 0000000..27b836b --- /dev/null +++ b/combustcean-tongs/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "combustcean-tongs" +version = "0.1.0" +edition = "2024" + +[dependencies] diff --git a/combustcean-tongs/src/main.rs b/combustcean-tongs/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/combustcean-tongs/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +} diff --git a/devenv.lock b/devenv.lock new file mode 100644 index 0000000..d4cb994 --- /dev/null +++ b/devenv.lock @@ -0,0 +1,86 @@ +{ + "nodes": { + "devenv": { + "locked": { + "dir": "src/modules", + "lastModified": 1779749056, + "narHash": "sha256-AtocdrunzuxTvSDn+82RntEhrs6TicM6Z4/zNQS9KKg=", + "owner": "cachix", + "repo": "devenv", + "rev": "099ac65fcef79e88127bdc06adbd1ea94255274a", + "type": "github" + }, + "original": { + "dir": "src/modules", + "owner": "cachix", + "repo": "devenv", + "type": "github" + } + }, + "nixpkgs": { + "inputs": { + "nixpkgs-src": "nixpkgs-src" + }, + "locked": { + "lastModified": 1778507786, + "narHash": "sha256-HzSQCKMsMr8r55LwM1JuzIOB+8bzk0FEv6sItKvsfoY=", + "owner": "cachix", + "repo": "devenv-nixpkgs", + "rev": "8f24a228a782e24576b155d1e39f0d914b380691", + "type": "github" + }, + "original": { + "owner": "cachix", + "ref": "rolling", + "repo": "devenv-nixpkgs", + "type": "github" + } + }, + "nixpkgs-src": { + "flake": false, + "locked": { + "lastModified": 1778274207, + "narHash": "sha256-I4puXmX1iovcCHZlRmztO3vW0mAbbRvq4F8wgIMQ1MM=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "b3da656039dc7a6240f27b2ef8cc6a3ef3bccae7", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "devenv": "devenv", + "nixpkgs": "nixpkgs", + "rust-overlay": "rust-overlay" + } + }, + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1779765539, + "narHash": "sha256-2QxuD5gJcfCFsnqv54LGEHQKvd+K+DW/ecERwAvuA7w=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "09889992e640378f7008c3302b9d4892579df610", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} \ No newline at end of file diff --git a/devenv.nix b/devenv.nix new file mode 100644 index 0000000..cacfb7a --- /dev/null +++ b/devenv.nix @@ -0,0 +1,25 @@ +{ + pkgs, + lib, + config, + inputs, + ... +}: { + processes."tongs:watch" = { + cwd = "./combustcean-tongs"; + watch = { + paths = [./combustcean-tongs/src]; + extensions = ["rs" "toml"]; + }; + exec = '' + cargo build --target thumbv7em-none-eabihf --release && \ + run-fap ../target/thumbv7em-none-eabihf/release/combustcean-tongs.fap -p /dev/ttyACM0 + ''; + }; + + packages = with pkgs; [ + # keep-sorted start + jujutsu + # keep-sorted end + ]; +} diff --git a/devenv.yaml b/devenv.yaml new file mode 100644 index 0000000..37e8589 --- /dev/null +++ b/devenv.yaml @@ -0,0 +1,8 @@ +inputs: + nixpkgs: + url: github:cachix/devenv-nixpkgs/rolling + rust-overlay: + url: github:oxalica/rust-overlay + inputs: + nixpkgs: + follows: nixpkgs