From 9944db3d2b459be969c57595fe7ce07d92940c83 Mon Sep 17 00:00:00 2001 From: maxstrb Date: Wed, 26 Nov 2025 11:40:20 +0100 Subject: [PATCH] Project setup --- .envrc | 1 + .gitignore | 3 +++ Cargo.toml | 6 ++++++ flake.lock | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 28 ++++++++++++++++++++++++++++ src/main.rs | 3 +++ 6 files changed, 89 insertions(+) create mode 100644 .envrc create mode 100644 .gitignore create mode 100644 Cargo.toml create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 src/main.rs diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..8392d15 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fdba76b --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +target + +.direnv \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..d3af60e --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "floating-calculator" +version = "0.1.0" +edition = "2024" + +[dependencies] diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..70a1762 --- /dev/null +++ b/flake.lock @@ -0,0 +1,48 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1763966396, + "narHash": "sha256-6eeL1YPcY1MV3DDStIDIdy/zZCDKgHdkCmsrLJFiZf0=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "5ae3b07d8d6527c42f17c876e404993199144b6a", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs", + "rust-overlay": "rust-overlay" + } + }, + "rust-overlay": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1764124769, + "narHash": "sha256-vcoOEy3i8AGJi3Y2C48hrf6CuL2h8W1gLe1gNt72Kxg=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "5da8c00313b4434f00aed6b4c94cd3b207bafdc5", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..ef403a2 --- /dev/null +++ b/flake.nix @@ -0,0 +1,28 @@ +{ + description = "My rust development shell"; + inputs = { + nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable"; + rust-overlay = { + url = "github:oxalica/rust-overlay"; + inputs.nixpkgs.follows = "nixpkgs"; + }; + }; + outputs = {nixpkgs, ...} @ inputs: let + system = "x86_64-linux"; + overlays = [(import inputs.rust-overlay)]; + pkgs = import nixpkgs { + inherit system overlays; + }; + in { + devShells."${system}" = { + default = pkgs.mkShell { + buildInputs = with pkgs; [ + gcc + gnumake + rust-bin.stable.latest.default + evcxr + ]; + }; + }; + }; +} diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..e7a11a9 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,3 @@ +fn main() { + println!("Hello, world!"); +}